diff --git a/lib/compiler.js b/lib/compiler.js index 90b2b8f1..18658eda 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -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