From b3913d04001f031342794c71acfc4a1bae4e01b3 Mon Sep 17 00:00:00 2001 From: anjianshi Date: Sat, 9 Jan 2016 10:07:17 +0800 Subject: [PATCH 1/2] Support lodash template's HTML "escape" delimiter (<%- %>) --- loader.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; +}; From ca5048338541155996389dd49a9cdce224c9081e Mon Sep 17 00:00:00 2001 From: anjianshi Date: Sat, 9 Jan 2016 10:10:04 +0800 Subject: [PATCH 2/2] fix comment --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }