From 26dcb98f1522e8da79e4befc24f0875bd6ef0bbc Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Mon, 19 Mar 2018 15:49:09 +0100 Subject: [PATCH] fix(compiler): Set single entry name #895 --- lib/compiler.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/compiler.js b/lib/compiler.js index 18658eda..9dd1cc1c 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -5,7 +5,6 @@ * */ 'use strict'; -const _ = require('lodash'); const path = require('path'); const NodeTemplatePlugin = require('webpack/lib/node/NodeTemplatePlugin'); const NodeTargetPlugin = require('webpack/lib/node/NodeTargetPlugin'); @@ -37,7 +36,7 @@ module.exports.compileTemplate = function compileTemplate (template, context, ou publicPath: compilation.outputOptions.publicPath }; // Store the result of the parent compilation before we start the child compilation - const assetsBeforeCompilation = _.assign({}, compilation.assets[outputOptions.filename]); + const assetsBeforeCompilation = Object.assign({}, compilation.assets[outputOptions.filename]); // Create an additional child compiler which takes the template // and turns it into an Node.JS html factory. // This allows us to use loaders during the compilation @@ -47,7 +46,7 @@ module.exports.compileTemplate = function compileTemplate (template, context, ou 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 SingleEntryPlugin(this.context, template, compilerName).apply(childCompiler); new LoaderTargetPlugin('node').apply(childCompiler); // Fix for "Uncaught TypeError: __webpack_require__(...) is not a function"