Skip to content

Commit 5a9973b

Browse files
committed
Updated extract-chunks.js getNames to handle circular dependencies
1 parent 839f0d1 commit 5a9973b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib/extract-chunks.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ function getChunkEntryNames (chunk) {
3131
}
3232
}
3333

34+
const processedGroups = new Set();
3435
function getNames (groups) {
3536
const Entrypoint = require('webpack/lib/Entrypoint')
3637
const names = []
@@ -40,8 +41,10 @@ function getNames (groups) {
4041
if (group.options.name) {
4142
names.push(group.options.name)
4243
}
43-
} else {
44-
names.push(...getNames(group.parentsIterable))
44+
}
45+
else if (!processedGroups.has(group)) {
46+
processedGroups.add(group);
47+
names.push(...getNames(group.parentsIterable));
4548
}
4649
}
4750
return names

0 commit comments

Comments
 (0)