Fix template compilation for es6 modules (#550)
This commit is contained in:
parent
1b4f8efe94
commit
7a781a4120
3
index.js
3
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.');
|
||||
|
|
|
|||
Loading…
Reference in New Issue