Skip to content

Commit 3419ddc

Browse files
committed
use dedupe plugin later in compilation
fixed webpack/style-loader#54
1 parent 53a5346 commit 3419ddc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/Compilation.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,8 @@ Compilation.prototype.seal = function seal(callback) {
503503
return callback(err);
504504
}
505505

506+
this.applyPlugins("after-optimize-tree", this.chunks, this.modules);
507+
506508
var shouldRecord = this.applyPluginsBailResult("should-record") !== false;
507509

508510
this.applyPlugins("revive-modules", this.modules, this.records);

lib/optimize/DedupePlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ DedupePlugin.prototype.apply = function(compiler) {
3333
}
3434
});
3535
});
36-
compilation.plugin("after-optimize-chunks", function(chunks) {
36+
compilation.plugin("after-optimize-tree", function(chunks) {
3737
var entryChunks = chunks.filter(function(c) { return c.entry; });
3838
entryChunks.forEach(function(chunk) { // for each entry chunk
3939
var hasDeduplicatedModules = false;

0 commit comments

Comments
 (0)