Merge pull request #160 from anjianshi/feature/loaders

Support lodash template's HTML "escape" delimiter (<%- %>)
This commit is contained in:
Jan Nicklas 2016-01-09 08:45:26 +01:00
commit 9a53beb609
2 changed files with 3 additions and 3 deletions

View File

@ -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);
}

View File

@ -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;
};