diff --git a/index.js b/index.js index 7665099..b8bc50f 100644 --- a/index.js +++ b/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); } diff --git a/loader.js b/loader.js index 9932354..2b8cce7 100644 --- a/loader.js +++ b/loader.js @@ -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; -}; \ No newline at end of file + return 'var _ = require("lodash"); module.exports = ' + template; +};