Skip to content

Commit 5020104

Browse files
authored
allow boolean values for node and performance
1 parent f04cce8 commit 5020104

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

‎lib/WebpackOptionsDefaulter.js‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,13 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
6868
this.set("output.devtoolLineToLine", false);
6969
this.set("output.strictModuleExceptionHandling", false);
7070

71-
this.set("node", "call", value => Object.assign({}, value));
71+
this.set("node", "call", value => {
72+
if(typeof value === "boolean") {
73+
return value;
74+
} else {
75+
return Object.assign({}, value);
76+
}
77+
});
7278
this.set("node.console", false);
7379
this.set("node.process", true);
7480
this.set("node.global", true);
@@ -77,7 +83,13 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
7783
this.set("node.__filename", "mock");
7884
this.set("node.__dirname", "mock");
7985

80-
this.set("performance", "call", value => Object.assign({}, value));
86+
this.set("performance", "call", value => {
87+
if(typeof value === "boolean") {
88+
return value;
89+
} else {
90+
return Object.assign({}, value);
91+
}
92+
});
8193
this.set("performance.maxAssetSize", 250000);
8294
this.set("performance.maxEntrypointSize", 250000);
8395
this.set("performance.hints", false);

0 commit comments

Comments
 (0)