Skip to content

Commit

Permalink
Fix template compilation for es6 modules (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
spuf authored and jantimon committed Jan 29, 2017
1 parent 78cb986 commit 7c0ad50
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,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.');
Expand Down

0 comments on commit 7c0ad50

Please sign in to comment.