webpack
Multi Mustache loader forCompiles Mustache templates with Hogan and optionally html-minifier. Support both single template file and multi template file.
the multi template file should only write as below:
Install
$ npm i multi-mustache-loader
Usage
module: loaders: test: /\.html$/ loader: 'multi-mustache' // loader: 'multi-mustache?minify' // loader: 'multi-mustache?{ minify: { removeComments: false } }' // loader: 'multi-mustache?noShortcut'
one file one template
template.html
{{#user}}{{name}}{{/user}}
var template = ;var html = ;
one file more than one template
multi-template.html
var template = ;var htmlName = template'tmp-name' name: 'multi-mustache-loader' ;var htmlPost = template'tmp-post'post:'hello multi-mustache-loader!';
If noShortcut
is passed, then Hogan compiled template is returned instead, so
you can pass it as partial.
var template = ;var template2 = ;var html = ;
License
MIT