Skip to content

Commit c47150c

Browse files
committed
Clone optimization config in Defaulter
webpack#6565
1 parent ec4ec8e commit c47150c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/WebpackOptionsDefaulter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
193193
options => (isProductionLikeMode(options) ? "warning" : false)
194194
);
195195

196+
this.set("optimization", "call", value => Object.assign({}, value));
196197
this.set("optimization.removeAvailableModules", true);
197198
this.set("optimization.removeEmptyChunks", true);
198199
this.set("optimization.mergeDuplicateChunks", true);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = function(config) {
2+
// This test can't run in development mode as it depends on the flagIncludedChunks optimization
3+
return config.mode !== "development";
4+
};

0 commit comments

Comments
 (0)