Skip to content

Commit

Permalink
fix(hooks): Call tapable.apply directly #879
Browse files Browse the repository at this point in the history
  • Loading branch information
jantimon committed Mar 6, 2018
1 parent eb0b765 commit bcbb036
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ module.exports.compileTemplate = function compileTemplate (template, context, ou
const compilerName = getCompilerName(context, outputFilename);
const childCompiler = compilation.createChildCompiler(compilerName, outputOptions);
childCompiler.context = context;
childCompiler.apply(
new NodeTemplatePlugin(outputOptions),
new NodeTargetPlugin(),
new LibraryTemplatePlugin('HTML_WEBPACK_PLUGIN_RESULT', 'var'),
new SingleEntryPlugin(this.context, template),
new LoaderTargetPlugin('node')
);
new NodeTemplatePlugin(outputOptions).apply(childCompiler);
new NodeTargetPlugin().apply(childCompiler);
new LibraryTemplatePlugin('HTML_WEBPACK_PLUGIN_RESULT', 'var').apply(childCompiler);
new SingleEntryPlugin(this.context, template).apply(childCompiler);
new LoaderTargetPlugin('node').apply(childCompiler);

// Fix for "Uncaught TypeError: __webpack_require__(...) is not a function"
// Hot module replacement requires that every child compiler has its own
Expand Down

0 comments on commit bcbb036

Please sign in to comment.