Skip to content

Commit 4b81320

Browse files
committed
allow limit requests and chunk size
with defaults
1 parent b34663c commit 4b81320

File tree

14 files changed

+389
-354
lines changed

14 files changed

+389
-354
lines changed

lib/optimize/AutomaticCommonsChunksPlugin.js

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@ const sortByIdentifier = (a, b) => {
1212
return 0;
1313
};
1414

15+
const getMaxBlockRequests = chunk => {
16+
return chunk.mapBlocks(block => block.chunks.length).reduce(Math.max, 0);
17+
};
18+
1519
module.exports = class AutomaticCommonsChunksPlugin {
1620
constructor(options) {
1721
this.options = Object.assign({}, {
1822
initialChunks: false,
23+
minSize: 30000,
24+
maxRequests: 10,
1925
onlyNamed: false,
2026
name: undefined
2127
}, options);
@@ -53,17 +59,30 @@ module.exports = class AutomaticCommonsChunksPlugin {
5359
}
5460
modules.add(module);
5561
}
56-
const entries = Array.from(chunksModulesMap.entries()).sort((a, b) => {
57-
const chunkNameA = chunksNameMap.get(a[0]);
58-
const chunkNameB = chunksNameMap.get(b[0]);
62+
const entries = Array.from(chunksModulesMap.entries(), pair => {
63+
const modules = pair[1];
64+
const size = Array.from(modules, m => m.size()).reduce((a, b) => a + b, 0);
65+
return {
66+
key: pair[0],
67+
modules,
68+
size
69+
};
70+
}).sort((a, b) => {
71+
// 1. by chunk name
72+
// 2. by total modules size
73+
// 3. by module identifiers
74+
const chunkNameA = chunksNameMap.get(a.key);
75+
const chunkNameB = chunksNameMap.get(b.key);
5976
if(chunkNameA && !chunkNameB) return -1;
6077
if(!chunkNameA && chunkNameB) return 1;
6178
if(chunkNameA && chunkNameB) {
6279
if(chunkNameA < chunkNameB) return -1;
6380
if(chunkNameA > chunkNameB) return 1;
6481
}
65-
const modulesA = a[1];
66-
const modulesB = b[1];
82+
const diffSize = b.size - a.size;
83+
if(diffSize) return diffSize;
84+
const modulesA = a.modules;
85+
const modulesB = b.modules;
6786
const diff = modulesA.size - modulesB.size;
6887
if(diff) return diff;
6988
modulesA.sort();
@@ -81,14 +100,19 @@ module.exports = class AutomaticCommonsChunksPlugin {
81100
}
82101
});
83102
let changed = false;
84-
for(const [key, modules] of entries) {
103+
for(const { key, modules, size } of entries) {
85104
const chunkName = chunksNameMap.get(key);
105+
if(!chunkName && size < this.options.minSize) continue;
86106
const newChunk = compilation.addChunk(chunkName);
87107
let splitted = false;
88108
const firstModule = modules.values().next().value;
89109
for(const chunk of firstModule.chunksIterable) {
110+
// skip itself when already a chunk of the module
90111
if(newChunk === chunk) continue;
112+
// only use selected chunks
91113
if(!indexMap.get(chunk)) continue;
114+
// respect max requests when not a named chunk
115+
if(!chunkName && getMaxBlockRequests(chunk) >= this.options.maxRequests) continue;
92116
splitted = true;
93117
chunk.split(newChunk);
94118
for(const module of modules) {
@@ -110,6 +134,9 @@ module.exports = class AutomaticCommonsChunksPlugin {
110134
module.addChunk(newChunk);
111135
}
112136
changed = true;
137+
} else if(!chunkName) {
138+
newChunk.remove("empty");
139+
chunks.splice(chunks.indexOf(newChunk), 1);
113140
}
114141
}
115142
if(changed) return true;

test/statsCases/aggressive-splitting-entry/expected.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
Hash: 66d838747959da8f85b266d838747959da8f85b2
1+
Hash: 864952964099a084c3fe864952964099a084c3fe
22
Child fitting:
3-
Hash: 66d838747959da8f85b2
3+
Hash: 864952964099a084c3fe
44
Time: Xms
55
Asset Size Chunks Chunk Names
6-
8312a35cc8856fc31fbe.js 2.23 KiB 0 [emitted]
7-
85d4742e44610b5d60db.js 5.78 KiB 4 [emitted]
6+
dde8612c7eca2e974178.js 6.18 KiB 0 [emitted]
7+
fa8f58b2770476d486d5.js 1.94 KiB 4 [emitted]
88
54e2254b9a017be86038.js 1 KiB 5 [emitted]
99
2b397186654df41bcf77.js 1.93 KiB 6 [emitted]
10-
Entrypoint main = 85d4742e44610b5d60db.js 54e2254b9a017be86038.js 2b397186654df41bcf77.js 8312a35cc8856fc31fbe.js
11-
chunk {0} 8312a35cc8856fc31fbe.js 1.87 KiB [initial] [rendered]
10+
Entrypoint main = fa8f58b2770476d486d5.js 54e2254b9a017be86038.js 2b397186654df41bcf77.js dde8612c7eca2e974178.js
11+
chunk {0} dde8612c7eca2e974178.js 1.87 KiB [entry] [rendered]
1212
> aggressive-splitted main [4] ./index.js
1313
[4] ./index.js 112 bytes {0} [built]
1414
[6] ./f.js 899 bytes {0} [built]
1515
[7] ./g.js 899 bytes {0} [built]
16-
chunk {4} 85d4742e44610b5d60db.js 1.76 KiB [entry] [rendered] [recorded]
16+
chunk {4} fa8f58b2770476d486d5.js 1.76 KiB [initial] [rendered] [recorded]
1717
> aggressive-splitted main [4] ./index.js
1818
[2] ./d.js 899 bytes {4} [built]
1919
[5] ./a.js 899 bytes {4} [built]
@@ -25,20 +25,20 @@ Child fitting:
2525
[0] ./b.js 899 bytes {6} [built]
2626
[1] ./c.js 899 bytes {6} [built]
2727
Child content-change:
28-
Hash: 66d838747959da8f85b2
28+
Hash: 864952964099a084c3fe
2929
Time: Xms
3030
Asset Size Chunks Chunk Names
31-
8312a35cc8856fc31fbe.js 2.23 KiB 0 [emitted]
32-
85d4742e44610b5d60db.js 5.78 KiB 4 [emitted]
31+
dde8612c7eca2e974178.js 6.18 KiB 0 [emitted]
32+
fa8f58b2770476d486d5.js 1.94 KiB 4 [emitted]
3333
54e2254b9a017be86038.js 1 KiB 5 [emitted]
3434
2b397186654df41bcf77.js 1.93 KiB 6 [emitted]
35-
Entrypoint main = 85d4742e44610b5d60db.js 54e2254b9a017be86038.js 2b397186654df41bcf77.js 8312a35cc8856fc31fbe.js
36-
chunk {0} 8312a35cc8856fc31fbe.js 1.87 KiB [initial] [rendered]
35+
Entrypoint main = fa8f58b2770476d486d5.js 54e2254b9a017be86038.js 2b397186654df41bcf77.js dde8612c7eca2e974178.js
36+
chunk {0} dde8612c7eca2e974178.js 1.87 KiB [entry] [rendered]
3737
> aggressive-splitted main [4] ./index.js
3838
[4] ./index.js 112 bytes {0} [built]
3939
[6] ./f.js 899 bytes {0} [built]
4040
[7] ./g.js 899 bytes {0} [built]
41-
chunk {4} 85d4742e44610b5d60db.js 1.76 KiB [entry] [rendered] [recorded]
41+
chunk {4} fa8f58b2770476d486d5.js 1.76 KiB [initial] [rendered] [recorded]
4242
> aggressive-splitted main [4] ./index.js
4343
[2] ./d.js 899 bytes {4} [built]
4444
[5] ./a.js 899 bytes {4} [built]

test/statsCases/aggressive-splitting-entry2/expected.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
Hash: 3ee24ba6bc0fc181d72b3ee24ba6bc0fc181d72b
1+
Hash: b0a7533b6ba8cbc8c989b0a7533b6ba8cbc8c989
22
Child fitting:
3-
Hash: 3ee24ba6bc0fc181d72b
3+
Hash: b0a7533b6ba8cbc8c989
44
Time: Xms
55
Asset Size Chunks Chunk Names
6-
57459d21f0df51ccc855.js 2.42 KiB 0 [emitted]
6+
2b8228c59dc2ff310162.js 8.92 KiB 0 [emitted]
77
7c20dbb0769a7f28f25f.js 1.05 KiB 1 [emitted]
8-
60426dd4d835ada7b684.js 8.33 KiB 4 [emitted]
8+
fa8f58b2770476d486d5.js 1.94 KiB 4 [emitted]
99
445908eb332cabac751e.js 1.93 KiB 5 [emitted]
10-
Entrypoint main = 60426dd4d835ada7b684.js 445908eb332cabac751e.js 57459d21f0df51ccc855.js
11-
chunk {0} 57459d21f0df51ccc855.js 1.87 KiB [initial] [rendered]
10+
Entrypoint main = fa8f58b2770476d486d5.js 445908eb332cabac751e.js 2b8228c59dc2ff310162.js
11+
chunk {0} 2b8228c59dc2ff310162.js 1.87 KiB [entry] [rendered]
1212
> aggressive-splitted main [4] ./index.js
1313
[3] ./e.js 899 bytes {0} [built]
1414
[4] ./index.js 111 bytes {0} [built]
1515
[6] ./f.js 900 bytes {0} [built]
1616
chunk {1} 7c20dbb0769a7f28f25f.js 916 bytes {0+4+5} [rendered]
1717
> [4] ./index.js 7:0-13
1818
[7] ./g.js 916 bytes {1} [built]
19-
chunk {4} 60426dd4d835ada7b684.js 1.76 KiB [entry] [rendered] [recorded]
19+
chunk {4} fa8f58b2770476d486d5.js 1.76 KiB [initial] [rendered] [recorded]
2020
> aggressive-splitted main [4] ./index.js
2121
[2] ./d.js 899 bytes {4} [built]
2222
[5] ./a.js 899 bytes {4} [built]
@@ -25,23 +25,23 @@ Child fitting:
2525
[0] ./b.js 899 bytes {5} [built]
2626
[1] ./c.js 899 bytes {5} [built]
2727
Child content-change:
28-
Hash: 3ee24ba6bc0fc181d72b
28+
Hash: b0a7533b6ba8cbc8c989
2929
Time: Xms
3030
Asset Size Chunks Chunk Names
31-
57459d21f0df51ccc855.js 2.42 KiB 0 [emitted]
31+
2b8228c59dc2ff310162.js 8.92 KiB 0 [emitted]
3232
7c20dbb0769a7f28f25f.js 1.05 KiB 1 [emitted]
33-
60426dd4d835ada7b684.js 8.33 KiB 4 [emitted]
33+
fa8f58b2770476d486d5.js 1.94 KiB 4 [emitted]
3434
445908eb332cabac751e.js 1.93 KiB 5 [emitted]
35-
Entrypoint main = 60426dd4d835ada7b684.js 445908eb332cabac751e.js 57459d21f0df51ccc855.js
36-
chunk {0} 57459d21f0df51ccc855.js 1.87 KiB [initial] [rendered]
35+
Entrypoint main = fa8f58b2770476d486d5.js 445908eb332cabac751e.js 2b8228c59dc2ff310162.js
36+
chunk {0} 2b8228c59dc2ff310162.js 1.87 KiB [entry] [rendered]
3737
> aggressive-splitted main [4] ./index.js
3838
[3] ./e.js 899 bytes {0} [built]
3939
[4] ./index.js 111 bytes {0} [built]
4040
[6] ./f.js 900 bytes {0} [built]
4141
chunk {1} 7c20dbb0769a7f28f25f.js 916 bytes {0+4+5} [rendered]
4242
> [4] ./index.js 7:0-13
4343
[7] ./g.js 916 bytes {1} [built]
44-
chunk {4} 60426dd4d835ada7b684.js 1.76 KiB [entry] [rendered] [recorded]
44+
chunk {4} fa8f58b2770476d486d5.js 1.76 KiB [initial] [rendered] [recorded]
4545
> aggressive-splitted main [4] ./index.js
4646
[2] ./d.js 899 bytes {4} [built]
4747
[5] ./a.js 899 bytes {4} [built]
Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,49 @@
1-
Hash: 0f07aca3bcc352ccf4df
1+
Hash: 68735d6d492523fdd0c6
22
Time: Xms
33
Asset Size Chunks Chunk Names
44
8111929f6761a49abd03.js 1.96 KiB 0 [emitted]
55
eed136bb9b1f0de139a9.js 1.94 KiB 1 [emitted]
6-
a787132a2376949dd13f.js 1.94 KiB 2 [emitted]
7-
c04e6c1042793fb803ed.js 1 KiB 3 [emitted]
6+
127dcc911b6e4c95204d.js 1 KiB 2 [emitted]
7+
2bfb7afd1f901f4f309f.js 1.94 KiB 3 [emitted]
88
e013686b7b1ce4bd99ba.js 1.94 KiB 4 [emitted]
9-
af4d0eb806c83010aa9c.js 1 KiB 5 [emitted]
9+
5ac554478945d88843c9.js 1 KiB 5 [emitted]
1010
2eb796a695b728235608.js 1.01 KiB 6 [emitted]
11-
810442a28510d745748d.js 8.31 KiB 7 [emitted] main
12-
Entrypoint main = 810442a28510d745748d.js
13-
chunk {0} 8111929f6761a49abd03.js 1.76 KiB {7}
11+
8d11ec270922149a5452.js 8.37 KiB 7 [emitted] main
12+
Entrypoint main = 8d11ec270922149a5452.js
13+
chunk {0} 8111929f6761a49abd03.js 1.76 KiB {7} [recorded]
14+
> aggressive-splitted duplicate [11] ./index.js 4:0-51
15+
> aggressive-splitted duplicate [11] ./index.js 5:0-44
16+
> aggressive-splitted duplicate [11] ./index.js 6:0-72
1417
[3] ./f.js 899 bytes {0} [built]
1518
[4] ./g.js 901 bytes {0} [built]
16-
chunk {1} eed136bb9b1f0de139a9.js 1.76 KiB {7}
19+
chunk {1} eed136bb9b1f0de139a9.js 1.76 KiB {7} [recorded]
20+
> aggressive-splitted duplicate [11] ./index.js 3:0-30
21+
> aggressive-splitted duplicate [11] ./index.js 5:0-44
22+
> aggressive-splitted duplicate [11] ./index.js 6:0-72
1723
[1] ./d.js 899 bytes {1} [built]
1824
[2] ./e.js 899 bytes {1} [built]
19-
chunk {2} a787132a2376949dd13f.js 1.76 KiB {7} [recorded]
20-
[8] ./j.js 901 bytes {2} [built]
21-
[9] ./k.js 899 bytes {2} [built]
22-
chunk {3} c04e6c1042793fb803ed.js 899 bytes {7}
23-
[0] ./b.js 899 bytes {3} [built]
25+
chunk {2} 127dcc911b6e4c95204d.js 899 bytes {7}
26+
> aggressive-splitted duplicate [11] ./index.js 2:0-23
27+
> aggressive-splitted duplicate [11] ./index.js 3:0-30
28+
[5] ./c.js 899 bytes {2} [built]
29+
chunk {3} 2bfb7afd1f901f4f309f.js 1.76 KiB {7} [recorded]
30+
> aggressive-splitted duplicate [11] ./index.js 4:0-51
31+
> aggressive-splitted duplicate [11] ./index.js 6:0-72
32+
[8] ./j.js 901 bytes {3} [built]
33+
[9] ./k.js 899 bytes {3} [built]
2434
chunk {4} e013686b7b1ce4bd99ba.js 1.76 KiB {7} [recorded]
35+
> aggressive-splitted duplicate [11] ./index.js 4:0-51
36+
> aggressive-splitted duplicate [11] ./index.js 6:0-72
2537
[6] ./h.js 899 bytes {4} [built]
2638
[7] ./i.js 899 bytes {4} [built]
27-
chunk {5} af4d0eb806c83010aa9c.js 899 bytes {7}
28-
[5] ./c.js 899 bytes {5} [built]
39+
chunk {5} 5ac554478945d88843c9.js 899 bytes {7}
40+
> aggressive-splitted duplicate [11] ./index.js 2:0-23
41+
> aggressive-splitted duplicate [11] ./index.js 5:0-44
42+
> aggressive-splitted duplicate [11] ./index.js 6:0-72
43+
[0] ./b.js 899 bytes {5} [built]
2944
chunk {6} 2eb796a695b728235608.js 899 bytes {7}
3045
> [11] ./index.js 1:0-16
3146
[10] ./a.js 899 bytes {6} [built]
32-
chunk {7} 810442a28510d745748d.js (main) 248 bytes [entry]
47+
chunk {7} 8d11ec270922149a5452.js (main) 248 bytes [entry]
3348
> main [11] ./index.js
3449
[11] ./index.js 248 bytes {7} [built]

test/statsCases/async-commons-chunk-all-selected/expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Entrypoint entry = entry.js
2-
chunk {0} 0.js 21 bytes {3} [rendered]
2+
chunk {0} 0.js 21 bytes {3} [rendered] async commons chunk
33
> async commons [3] ./index.js 2:1-5:3
44
> async commons [3] ./index.js 9:1-13:3
55
> async commons [3] ./index.js 17:1-21:3

test/statsCases/async-commons-chunk-auto/expected.txt

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,53 @@ Entrypoint main = main.js
22
Entrypoint a = libs.js vendors.js a.js
33
Entrypoint b = libs.js vendors.js b.js
44
Entrypoint c = libs.js vendors.js c.js
5-
chunk {0} 0.chunk.js 20 bytes {2} {3} {4} {7} {8} {11} {12} [rendered] commons chunk
6-
[2] ./f.js 20 bytes {0} {9} {10} [built]
7-
chunk {1} 1.chunk.js 34 bytes {2} {3} {4} {8} {11} {12} [rendered]
8-
> [] 6:0-13
9-
[9] ./g.js 34 bytes {1} [built]
10-
chunk {2} 2.chunk.js 40 bytes {7} [rendered] commons chunk
11-
[0] ./d.js 20 bytes {2} {8} {9} {10} [built]
12-
[1] ./node_modules/x.js 20 bytes {2} {11} [built]
13-
chunk {3} 3.chunk.js 20 bytes {7} [rendered] commons chunk
14-
[3] ./node_modules/y.js 20 bytes {3} {12} [built]
15-
chunk {4} 4.chunk.js 122 bytes {7} [rendered]
5+
chunk {0} 0.chunk.js 182 bytes {4} [rendered]
166
> [8] ./index.js 1:0-13
17-
[7] ./a.js + 1 modules 122 bytes {4} {8} [built]
7+
[0] ./d.js 20 bytes {0} {1} {2} {5} {6} {7} [built]
8+
[1] ./node_modules/x.js 20 bytes {0} {1} {2} {8} [built]
9+
[3] ./node_modules/y.js 20 bytes {0} {1} {9} [built]
10+
[7] ./a.js + 1 modules 122 bytes {0} {5} [built]
1811
| ./a.js 87 bytes [built]
1912
| ./e.js 20 bytes [built]
20-
chunk {5} 5.chunk.js 72 bytes {7} [rendered]
13+
chunk {1} 1.chunk.js 152 bytes {4} [rendered]
2114
> [8] ./index.js 2:0-13
22-
[5] ./b.js 72 bytes {5} {9} [built]
23-
chunk {6} 6.chunk.js 92 bytes {7} [rendered]
15+
[0] ./d.js 20 bytes {0} {1} {2} {5} {6} {7} [built]
16+
[1] ./node_modules/x.js 20 bytes {0} {1} {2} {8} [built]
17+
[2] ./f.js 20 bytes {1} {2} {3} {6} {7} [built]
18+
[3] ./node_modules/y.js 20 bytes {0} {1} {9} [built]
19+
[5] ./b.js 72 bytes {1} {6} [built]
20+
chunk {2} 2.chunk.js 152 bytes {4} [rendered]
2421
> [8] ./index.js 3:0-13
25-
[4] ./node_modules/z.js 20 bytes {6} {12} [built]
26-
[6] ./c.js 72 bytes {6} {10} [built]
27-
chunk {7} main.js (main) 45 bytes [entry] [rendered]
22+
[0] ./d.js 20 bytes {0} {1} {2} {5} {6} {7} [built]
23+
[1] ./node_modules/x.js 20 bytes {0} {1} {2} {8} [built]
24+
[2] ./f.js 20 bytes {1} {2} {3} {6} {7} [built]
25+
[4] ./node_modules/z.js 20 bytes {2} {9} [built]
26+
[6] ./c.js 72 bytes {2} {7} [built]
27+
chunk {3} 3.chunk.js 54 bytes {0} {5+8+9} [rendered]
28+
> [] 6:0-13
29+
[2] ./f.js 20 bytes {1} {2} {3} {6} {7} [built]
30+
[9] ./g.js 34 bytes {3} [built]
31+
chunk {4} main.js (main) 45 bytes [entry] [rendered]
2832
> main [8] ./index.js
29-
[8] ./index.js 45 bytes {7} [built]
30-
chunk {8} a.js (a) 142 bytes [entry] [rendered]
33+
[8] ./index.js 45 bytes {4} [built]
34+
chunk {5} a.js (a) 142 bytes [entry] [rendered]
3135
> a []
32-
[0] ./d.js 20 bytes {2} {8} {9} {10} [built]
33-
[7] ./a.js + 1 modules 122 bytes {4} {8} [built]
36+
[0] ./d.js 20 bytes {0} {1} {2} {5} {6} {7} [built]
37+
[7] ./a.js + 1 modules 122 bytes {0} {5} [built]
3438
| ./a.js 87 bytes [built]
3539
| ./e.js 20 bytes [built]
36-
chunk {9} b.js (b) 112 bytes [entry] [rendered]
40+
chunk {6} b.js (b) 112 bytes [entry] [rendered]
3741
> b [5] ./b.js
38-
[0] ./d.js 20 bytes {2} {8} {9} {10} [built]
39-
[2] ./f.js 20 bytes {0} {9} {10} [built]
40-
[5] ./b.js 72 bytes {5} {9} [built]
41-
chunk {10} c.js (c) 112 bytes [entry] [rendered]
42+
[0] ./d.js 20 bytes {0} {1} {2} {5} {6} {7} [built]
43+
[2] ./f.js 20 bytes {1} {2} {3} {6} {7} [built]
44+
[5] ./b.js 72 bytes {1} {6} [built]
45+
chunk {7} c.js (c) 112 bytes [entry] [rendered]
4246
> c [6] ./c.js
43-
[0] ./d.js 20 bytes {2} {8} {9} {10} [built]
44-
[2] ./f.js 20 bytes {0} {9} {10} [built]
45-
[6] ./c.js 72 bytes {6} {10} [built]
46-
chunk {11} libs.js (libs) 20 bytes [initial] [rendered] vendors chunk
47-
[1] ./node_modules/x.js 20 bytes {2} {11} [built]
48-
chunk {12} vendors.js (vendors) 40 bytes [initial] [rendered] vendors chunk
49-
[3] ./node_modules/y.js 20 bytes {3} {12} [built]
50-
[4] ./node_modules/z.js 20 bytes {6} {12} [built]
47+
[0] ./d.js 20 bytes {0} {1} {2} {5} {6} {7} [built]
48+
[2] ./f.js 20 bytes {1} {2} {3} {6} {7} [built]
49+
[6] ./c.js 72 bytes {2} {7} [built]
50+
chunk {8} libs.js (libs) 20 bytes [initial] [rendered] vendors chunk
51+
[1] ./node_modules/x.js 20 bytes {0} {1} {2} {8} [built]
52+
chunk {9} vendors.js (vendors) 40 bytes [initial] [rendered] vendors chunk
53+
[3] ./node_modules/y.js 20 bytes {0} {1} {9} [built]
54+
[4] ./node_modules/z.js 20 bytes {2} {9} [built]

test/statsCases/async-commons-chunk/expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Entrypoint main = main.js
2-
chunk {0} 0.js 21 bytes {3} [rendered]
2+
chunk {0} 0.js 21 bytes {3} [rendered] async commons chunk
33
> async commons [3] ./index.js 2:1-5:3
44
> async commons [3] ./index.js 9:1-13:3
55
> async commons [3] ./index.js 17:1-21:3

test/statsCases/commons-chunk-min-size-0/expected.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Hash: 96561e55e52ce5dd05d9
1+
Hash: 8eb81b6ba5271547f2b2
22
Time: Xms
33
Asset Size Chunks Chunk Names
4-
entry-1.js 81 bytes 0 [emitted] entry-1
4+
entry-1.js 4.02 KiB 0 [emitted] entry-1
55
vendor-1.js 5.62 KiB 1 [emitted] vendor-1
66
Entrypoint entry-1 = vendor-1.js entry-1.js
77
Entrypoint vendor-1 = vendor-1.js

0 commit comments

Comments
 (0)