From 7a781a4120158dcc7329489f280e190960fca81f Mon Sep 17 00:00:00 2001 From: Arseny Date: Fri, 20 Jan 2017 14:11:09 +0300 Subject: [PATCH] Fix template compilation for es6 modules (#550) --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index 715701e..1d03558 100644 --- a/index.js +++ b/index.js @@ -233,6 +233,9 @@ HtmlWebpackPlugin.prototype.evaluateCompilationResult = function (compilation, s } catch (e) { return Promise.reject(e); } + if (typeof newSource === 'object' && newSource.__esModule && newSource.default) { + newSource = newSource.default; + } return typeof newSource === 'string' || typeof newSource === 'function' ? Promise.resolve(newSource) : Promise.reject('The loader "' + this.options.template + '" didn\'t return html.');