Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #4504 from timse/do-not-merge-empty-chunks
Do not merge empty chunks
  • Loading branch information
sokra committed Mar 18, 2017
2 parents a9972a3 + d67e125 commit fadafb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/optimize/FlagIncludedChunksPlugin.js
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions test/statsCases/commons-chunk-min-size-0/expected.txt
@@ -1,8 +1,8 @@
Hash: 9beb53e88067f8ed0026
Hash: dc6038bec87a57d1a45e
Time: Xms
Asset Size Chunks Chunk Names
entry-1.js 25 bytes 0 [emitted] entry-1
vendor-1.js 6.72 kB 1, 0 [emitted] vendor-1
vendor-1.js 6.7 kB 1 [emitted] vendor-1
chunk {0} entry-1.js (entry-1) 0 bytes {1} [initial] [rendered]
chunk {1} vendor-1.js (vendor-1) 329 bytes [entry] [rendered]
[0] (webpack)/test/statsCases/commons-chunk-min-size-0/modules/a.js 22 bytes {1} [built]
Expand Down

0 comments on commit fadafb2

Please sign in to comment.