Skip to content

Commit 3957566

Browse files
committed
move chunk parents check up
1 parent 8d193c7 commit 3957566

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎lib/optimize/RemoveParentModulesPlugin.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ class RemoveParentModulesPlugin {
6363
compilation.plugin(["optimize-chunks-basic", "optimize-extracted-chunks-basic"], (chunks) => {
6464
for(var index = 0; index < chunks.length; index++) {
6565
var chunk = chunks[index];
66+
if(chunk.parents.length === 0) continue;
6667

6768
// TODO consider Map when performance has improved https://gist.github.com/sokra/b36098368da7b8f6792fd7c85fca6311
6869
var cache = Object.create(null);
6970
var modules = chunk.modules.slice();
7071
for(var i = 0; i < modules.length; i++) {
7172
var module = modules[i];
7273

73-
if(chunk.parents.length === 0) continue;
7474
var dId = debugIds(module.chunks);
7575
var parentChunksWithModule;
7676
if((dId in cache) && dId !== "no") {

0 commit comments

Comments
 (0)