Skip to content

Commit

Permalink
disable optimization.removeAvailableModules in development by default
Browse files Browse the repository at this point in the history
We can't disable it in production yet, as this could be a breaking change.
  • Loading branch information
sokra committed Jul 26, 2019
1 parent 2e0ce0d commit a2c0461
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/WebpackOptionsDefaulter.js
Expand Up @@ -196,7 +196,12 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
);

this.set("optimization", "call", value => Object.assign({}, value));
this.set("optimization.removeAvailableModules", true);
// TODO webpack 5: Disable by default in a modes
this.set(
"optimization.removeAvailableModules",
"make",
options => options.mode !== "development"
);
this.set("optimization.removeEmptyChunks", true);
this.set("optimization.mergeDuplicateChunks", true);
this.set("optimization.flagIncludedChunks", "make", options =>
Expand Down

0 comments on commit a2c0461

Please sign in to comment.