do not incorporate chunks without modules

This commit is contained in:
Tim Sebastian 2017-03-18 12:20:08 +11:00
parent 416e5beeb4
commit d7ae9adfb2
1 changed files with 2 additions and 0 deletions

View File

@ -19,6 +19,8 @@ class FlagIncludedChunksPlugin {
// as we loop twice the current A will be B and B then A
if(chunkA.modules.length < chunkB.modules.length) return;
if(chunkB.modules.length === 0) return;
// is chunkB in chunkA?
for(let i = 0; i < chunkB.modules.length; i++) {
if(chunkA.modules.indexOf(chunkB.modules[i]) < 0) return;