Skip to content

Commit

Permalink
Merge pull request #7696 from webpack/bugfix/max-size-reasons
Browse files Browse the repository at this point in the history
copy chunk reason to maxSize parts
  • Loading branch information
sokra committed Jul 10, 2018
2 parents 365beb1 + b32a4f5 commit 8891bd5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/optimize/SplitChunksPlugin.js
Expand Up @@ -831,6 +831,7 @@ module.exports = class SplitChunksPlugin {
if (i !== results.length - 1) {
newPart = compilation.addChunk(name);
chunk.split(newPart);
newPart.chunkReason = chunk.chunkReason;
// Add all modules to the new chunk
for (const module of group.items) {
if (typeof module.chunkCondition === "function") {
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/StatsTestCases.test.js.snap
Expand Up @@ -2841,7 +2841,7 @@ exports[`StatsTestCases should print correct stats for split-chunks-max-size 1`]
chunk {11} prod-main~cd7c5bfc.js (main~cd7c5bfc) 1.57 KiB ={0}= ={1}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= ={8}= ={9}= ={10}= ={12}= [initial] [rendered]
> ./ main
[13] ./very-big.js?3 1.57 KiB {11} [built]
chunk {12} prod-vendors~main~7274e1de.js (vendors~main~7274e1de) 402 bytes ={0}= ={1}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= ={8}= ={9}= ={10}= ={11}= [initial] [rendered]
chunk {12} prod-vendors~main~7274e1de.js (vendors~main~7274e1de) 402 bytes ={0}= ={1}= ={2}= ={3}= ={4}= ={5}= ={6}= ={7}= ={8}= ={9}= ={10}= ={11}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~main)
> ./ main
[40] ./node_modules/big.js?1 268 bytes {12} [built]
[41] ./node_modules/small.js?1 67 bytes {12} [built]
Expand Down Expand Up @@ -2911,7 +2911,7 @@ Child development:
chunk {main~._very-big.js~62f7f644} dev-main~._very-big.js~62f7f644.js (main~._very-big.js~62f7f644) 1.57 KiB ={main~._big.js~1}= ={main~._in-some-directory_b}= ={main~._in-some-directory_very-big.js~8d76cf03}= ={main~._index.js~41f5a26e}= ={main~._inner-module_small.js~3}= ={main~._small.js~1}= ={main~._subfolder_big.js~b}= ={main~._subfolder_small.js~1}= ={main~._very-big.js~08cf55cf}= ={main~._very-big.js~4647fb9d}= ={vendors~main~._node_modules_b}= ={vendors~main~._node_modules_very-big.js~6bdbed7b}= [entry] [rendered]
> ./ main
[./very-big.js?1] 1.57 KiB {main~._very-big.js~62f7f644} [built]
chunk {vendors~main~._node_modules_b} dev-vendors~main~._node_modules_b.js (vendors~main~._node_modules_b) 402 bytes ={main~._big.js~1}= ={main~._in-some-directory_b}= ={main~._in-some-directory_very-big.js~8d76cf03}= ={main~._index.js~41f5a26e}= ={main~._inner-module_small.js~3}= ={main~._small.js~1}= ={main~._subfolder_big.js~b}= ={main~._subfolder_small.js~1}= ={main~._very-big.js~08cf55cf}= ={main~._very-big.js~4647fb9d}= ={main~._very-big.js~62f7f644}= ={vendors~main~._node_modules_very-big.js~6bdbed7b}= [initial] [rendered]
chunk {vendors~main~._node_modules_b} dev-vendors~main~._node_modules_b.js (vendors~main~._node_modules_b) 402 bytes ={main~._big.js~1}= ={main~._in-some-directory_b}= ={main~._in-some-directory_very-big.js~8d76cf03}= ={main~._index.js~41f5a26e}= ={main~._inner-module_small.js~3}= ={main~._small.js~1}= ={main~._subfolder_big.js~b}= ={main~._subfolder_small.js~1}= ={main~._very-big.js~08cf55cf}= ={main~._very-big.js~4647fb9d}= ={main~._very-big.js~62f7f644}= ={vendors~main~._node_modules_very-big.js~6bdbed7b}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~main)
> ./ main
[./node_modules/big.js?1] 268 bytes {vendors~main~._node_modules_b} [built]
[./node_modules/small.js?1] 67 bytes {vendors~main~._node_modules_b} [built]
Expand Down

0 comments on commit 8891bd5

Please sign in to comment.