azproduction/lmd

Add wrapper, regexp and banner options

Closed this issue · 2 comments

file.js

//  ...

Options

....
[{
      files: {
            to: ['**/*.html', '!to/**/*.html'],
      },
      wrapper: {
            prefix: '<script>',
            suffix: '</script>'
      },
      banner: 'Copyright ... <%= file %>'
      regexp: '<!--\\s*#include\\s*file\\s*=\\s*"\\s*[\\w.-]+\\s*"\\s*-->'
}]

file.html

<!-- #include file="file.js" -->

Result:

Copyright ... file.js

<script>
// ..code
</script>

Sorry for late response. It sounds like you ask me to invent yet another Grunt or Gulp :)

Don't you try to use build systems to process files before assemble them with LMD?

There're some cases in my workflow when I have to build the templates included script files.
Now I think you're right is not for LMD 😋 .