Skip to content

Commit b296e5a

Browse files
committed
use options object for NodeTemplatePlugin
1 parent 37e9515 commit b296e5a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lib/WebpackOptionsApply.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ WebpackOptionsApply.prototype.process = function(options, compiler) {
9494
var NodeTemplatePlugin = require("./node/NodeTemplatePlugin");
9595
var NodeTargetPlugin = require("./node/NodeTargetPlugin");
9696
compiler.apply(
97-
new NodeTemplatePlugin(options.output, options.target === "async-node"),
97+
new NodeTemplatePlugin(options.target === "async-node"),
9898
new FunctionModulePlugin(options.output),
9999
new NodeTargetPlugin(),
100100
new LoaderTargetPlugin("node")
@@ -119,7 +119,7 @@ WebpackOptionsApply.prototype.process = function(options, compiler) {
119119
var NodeTargetPlugin = require("./node/NodeTargetPlugin");
120120
var ExternalsPlugin = require("./ExternalsPlugin");
121121
compiler.apply(
122-
new NodeTemplatePlugin(options.output, true),
122+
new NodeTemplatePlugin(true),
123123
new FunctionModulePlugin(options.output),
124124
new NodeTargetPlugin(),
125125
new ExternalsPlugin("commonjs", [

lib/node/NodeTemplatePlugin.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ var NodeMainTemplatePlugin = require("./NodeMainTemplatePlugin");
66
var NodeChunkTemplatePlugin = require("./NodeChunkTemplatePlugin");
77
var NodeHotUpdateChunkTemplatePlugin = require("./NodeHotUpdateChunkTemplatePlugin");
88

9-
function NodeTemplatePlugin(options, asyncChunkLoading) {
10-
// TODO remove options parameter
11-
this.options = options;
12-
this.asyncChunkLoading = asyncChunkLoading;
9+
function NodeTemplatePlugin(options) {
10+
options = options || {};
11+
this.asyncChunkLoading = options.asyncChunkLoading;
1312
}
1413
module.exports = NodeTemplatePlugin;
1514
NodeTemplatePlugin.prototype.apply = function(compiler) {

0 commit comments

Comments
 (0)