Skip to content

Commit 45756a2

Browse files
committed
set chunk reasons symmetrical
1 parent f5b8225 commit 45756a2

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

lib/Chunk.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@ class Chunk {
308308
otherChunk.origins.forEach(origin => {
309309
this.origins.push(origin);
310310
});
311+
this.blocks.forEach(b => {
312+
b.chunkReason = reason;
313+
});
311314
this.origins.forEach(origin => {
312315
if(!origin.reasons) {
313316
origin.reasons = [reason];

test/statsCases/limit-chunk-count-plugin/expected.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Child
1616
Time: Xms
1717
Asset Size Chunks Chunk Names
1818
0.bundle.js 601 bytes 0 [emitted]
19-
bundle.js 6.12 kB 1 [emitted] main
19+
bundle.js 6.13 kB 1 [emitted] main
2020
chunk {0} 0.bundle.js 118 bytes {1} [rendered]
2121
[1] (webpack)/test/statsCases/limit-chunk-count-plugin/a.js 22 bytes {0} [built]
2222
[2] (webpack)/test/statsCases/limit-chunk-count-plugin/b.js 22 bytes {0} [built]
@@ -31,7 +31,7 @@ Child
3131
Asset Size Chunks Chunk Names
3232
0.bundle.js 454 bytes 0 [emitted]
3333
1.bundle.js 182 bytes 1 [emitted]
34-
bundle.js 6.11 kB 2 [emitted] main
34+
bundle.js 6.13 kB 2 [emitted] main
3535
chunk {0} 0.bundle.js 74 bytes {2} [rendered]
3636
[1] (webpack)/test/statsCases/limit-chunk-count-plugin/a.js 22 bytes {0} [built]
3737
[3] (webpack)/test/statsCases/limit-chunk-count-plugin/c.js 30 bytes {0} [built]
@@ -48,7 +48,7 @@ Child
4848
0.bundle.js 182 bytes 0 [emitted]
4949
1.bundle.js 204 bytes 1 [emitted]
5050
2.bundle.js 283 bytes 2 [emitted]
51-
bundle.js 6.1 kB 3 [emitted] main
51+
bundle.js 6.12 kB 3 [emitted] main
5252
chunk {0} 0.bundle.js 44 bytes {2} {3} [rendered]
5353
[2] (webpack)/test/statsCases/limit-chunk-count-plugin/b.js 22 bytes {0} [built]
5454
[5] (webpack)/test/statsCases/limit-chunk-count-plugin/e.js 22 bytes {0} [built]

test/statsCases/module-deduplication/expected.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Asset Size Chunks Chunk Names
66
3.js 622 bytes 3 [emitted]
77
4.js 622 bytes 4 [emitted]
88
5.js 622 bytes 5 [emitted]
9-
e3.js 7.3 kB 6 [emitted] e3
10-
e2.js 7.29 kB 7 [emitted] e2
9+
e3.js 7.33 kB 6 [emitted] e3
10+
e2.js 7.31 kB 7 [emitted] e2
1111
e1.js 7.28 kB 8 [emitted] e1
1212
chunk {0} 0.js 37 bytes {7} {8} [rendered]
1313
[6] (webpack)/test/statsCases/module-deduplication/async3.js 28 bytes {0} {3} [built]

test/statsCases/named-chunks-plugin-async/expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Time: Xms
33
Asset Size Chunks Chunk Names
44
chunk-containing-__a_js.js 266 bytes chunk-containing-__a_js [emitted]
55
chunk-containing-__b_js.js 123 bytes chunk-containing-__b_js [emitted]
6-
entry.js 5.99 kB entry [emitted] entry
6+
entry.js 6.01 kB entry [emitted] entry
77
[0] (webpack)/test/statsCases/named-chunks-plugin-async/modules/b.js 22 bytes {chunk-containing-__b_js} [built]
88
[1] (webpack)/test/statsCases/named-chunks-plugin-async/entry.js 47 bytes {entry} [built]
99
[2] (webpack)/test/statsCases/named-chunks-plugin-async/modules/a.js 37 bytes {chunk-containing-__a_js} [built]

test/statsCases/optimize-chunks/expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Time: Xms
88
4.js 162 bytes 4, 6 [emitted] chunk
99
5.js 306 bytes 5, 3 [emitted] cir2 from cir1
1010
6.js 80 bytes 6 [emitted] ac in ab
11-
main.js 6.78 kB 7 [emitted] main
11+
main.js 6.79 kB 7 [emitted] main
1212
chunk {0} 0.js (cir1) 81 bytes {3} {7} [rendered]
1313
> duplicate cir1 from cir2 [6] (webpack)/test/statsCases/optimize-chunks/circular2.js 1:0-79
1414
> duplicate cir1 [7] (webpack)/test/statsCases/optimize-chunks/index.js 13:0-54

0 commit comments

Comments
 (0)