From 668ab7ffb3761ab1856217c75e8ae085167ad719 Mon Sep 17 00:00:00 2001 From: Kees Kluskens Date: Tue, 8 Sep 2015 17:03:18 +0200 Subject: [PATCH] Bring back template path regex. This is untested code! --- index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.js b/index.js index eaa47ac..00dac75 100644 --- a/index.js +++ b/index.js @@ -31,6 +31,12 @@ function HtmlWebpackPlugin(options) { if(this.options.template.indexOf('!') === -1) { this.options.template = require.resolve('./loader.js') + '!' + path.resolve(this.options.template); } + // Resolve template path + this.options.template = this.options.template.replace( + /(\!)([^\/\\][^\!\?]+|[^\/\\!?])($|\?.+$)/, + function(match, prefix, filepath, postfix) { + return prefix + path.resolve(filepath) + postfix; + }); } HtmlWebpackPlugin.prototype.apply = function(compiler) {