Skip to content

Commit 8891bd5

Browse files
authored
Merge pull request webpack#7696 from webpack/bugfix/max-size-reasons
copy chunk reason to maxSize parts
2 parents 365beb1 + b32a4f5 commit 8891bd5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/optimize/SplitChunksPlugin.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,7 @@ module.exports = class SplitChunksPlugin {
831831
if (i !== results.length - 1) {
832832
newPart = compilation.addChunk(name);
833833
chunk.split(newPart);
834+
newPart.chunkReason = chunk.chunkReason;
834835
// Add all modules to the new chunk
835836
for (const module of group.items) {
836837
if (typeof module.chunkCondition === "function") {

test/__snapshots__/StatsTestCases.test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2841,7 +2841,7 @@ exports[`StatsTestCases should print correct stats for split-chunks-max-size 1`]
28412841
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]
28422842
> ./ main
28432843
[13] ./very-big.js?3 1.57 KiB {11} [built]
2844-
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]
2844+
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)
28452845
> ./ main
28462846
[40] ./node_modules/big.js?1 268 bytes {12} [built]
28472847
[41] ./node_modules/small.js?1 67 bytes {12} [built]
@@ -2911,7 +2911,7 @@ Child development:
29112911
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]
29122912
> ./ main
29132913
[./very-big.js?1] 1.57 KiB {main~._very-big.js~62f7f644} [built]
2914-
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]
2914+
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)
29152915
> ./ main
29162916
[./node_modules/big.js?1] 268 bytes {vendors~main~._node_modules_b} [built]
29172917
[./node_modules/small.js?1] 67 bytes {vendors~main~._node_modules_b} [built]

0 commit comments

Comments
 (0)