allow boolean values for node and performance

This commit is contained in:
Tobias Koppers 2017-09-06 17:15:03 +02:00 committed by GitHub
parent f04cce8278
commit 50201047d7
1 changed files with 14 additions and 2 deletions

View File

@ -68,7 +68,13 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
this.set("output.devtoolLineToLine", false);
this.set("output.strictModuleExceptionHandling", false);
this.set("node", "call", value => Object.assign({}, value));
this.set("node", "call", value => {
if(typeof value === "boolean") {
return value;
} else {
return Object.assign({}, value);
}
});
this.set("node.console", false);
this.set("node.process", true);
this.set("node.global", true);
@ -77,7 +83,13 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
this.set("node.__filename", "mock");
this.set("node.__dirname", "mock");
this.set("performance", "call", value => Object.assign({}, value));
this.set("performance", "call", value => {
if(typeof value === "boolean") {
return value;
} else {
return Object.assign({}, value);
}
});
this.set("performance.maxAssetSize", 250000);
this.set("performance.maxEntrypointSize", 250000);
this.set("performance.hints", false);