Skip to content

Commit 66f0f64

Browse files
committed
refactor commonsschunk plugin to handle set instead of array
1 parent dbdc39d commit 66f0f64

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎lib/optimize/CommonsChunkPlugin.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,11 @@ Take a look at the "name"/"names" or async/children option.`);
224224

225225
if(asyncOrNoSelectedChunk) {
226226
// nothing to do here
227-
if(!targetChunk.chunks) {
227+
if(!targetChunk.getChunks()) {
228228
return [];
229229
}
230230

231-
return targetChunk.chunks.filter((chunk) => {
231+
return Array.from(targetChunk.getChunks()).filter((chunk) => {
232232
// we can only move modules from this chunk if the "commonChunk" is the only parent
233233
return asyncOption || chunk.parents.length === 1;
234234
});

0 commit comments

Comments
 (0)