Merge pull request #160 from anjianshi/feature/loaders
Support lodash template's HTML "escape" delimiter (<%- %>)
This commit is contained in:
commit
9a53beb609
2
index.js
2
index.js
|
|
@ -28,7 +28,7 @@ function HtmlWebpackPlugin(options) {
|
|||
excludeChunks: [],
|
||||
title: 'Webpack App'
|
||||
}, options);
|
||||
// If the template doesn't use a loader use the blueimp template loader
|
||||
// If the template doesn't use a loader use the lodash template loader
|
||||
if(this.options.template.indexOf('!') === -1) {
|
||||
this.options.template = require.resolve('./loader.js') + '!' + path.resolve(this.options.template);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,5 +21,5 @@ module.exports = function (source) {
|
|||
// Use underscore for a minimalistic loader
|
||||
var options = loaderUtils.parseQuery(this.query);
|
||||
var template = _.template(source, options);
|
||||
return 'module.exports = ' + template;
|
||||
};
|
||||
return 'var _ = require("lodash"); module.exports = ' + template;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue