Skip to content

Commit

Permalink
fix(compiler): Set single entry name #895
Browse files Browse the repository at this point in the history
  • Loading branch information
jantimon committed Mar 19, 2018
1 parent 8131d8b commit 26dcb98
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit 26dcb98

Please sign in to comment.