Skip to content

Commit 826becb

Browse files
committed
add additional splitChunks test
1 parent 83301ab commit 826becb

File tree

2 files changed

+86
-1
lines changed

2 files changed

+86
-1
lines changed

test/statsCases/split-chunks/expected.txt

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,60 @@ Child all-chunks:
139139
> ./c c
140140
[0] ./d.js 20 bytes {4} {7} {11} {12} {13} [built]
141141
[2] ./f.js 20 bytes {1} {12} {13} [built]
142-
[5] ./c.js 72 bytes {8} {13} [built]
142+
[5] ./c.js 72 bytes {8} {13} [built]
143+
Child manual:
144+
Entrypoint main = default/main.js
145+
Entrypoint a = default/vendors.js default/a.js
146+
Entrypoint b = default/vendors.js default/b.js
147+
Entrypoint c = default/vendors.js default/c.js
148+
chunk {0} default/vendors.js (vendors) 112 bytes <{5}> ={8}= ={7}= ={6}= ={4}= ={3}= ={2}= >{1}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors)
149+
> ./c c
150+
> ./b b
151+
> ./a a
152+
> ./c [8] ./index.js 3:0-47
153+
> ./b [8] ./index.js 2:0-47
154+
> ./a [8] ./index.js 1:0-47
155+
[2] ./node_modules/x.js 20 bytes {0} [built]
156+
[3] ./node_modules/y.js 20 bytes {0} [built]
157+
[6] ./node_modules/z.js 20 bytes {0} [built]
158+
[10] multi x y z 52 bytes {0} [built]
159+
chunk {1} default/async-g.js (async-g) 54 bytes <{0}> <{2}> <{6}> [rendered]
160+
> ./g [] 6:0-47
161+
> ./g [] 6:0-47
162+
[1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built]
163+
[9] ./g.js 34 bytes {1} [built]
164+
chunk {2} default/async-a.js (async-a) 176 bytes <{5}> ={0}= >{1}< [rendered]
165+
> ./a [8] ./index.js 1:0-47
166+
[0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built]
167+
[7] ./a.js + 1 modules 156 bytes {2} {6} [built]
168+
| ./a.js 121 bytes [built]
169+
| ./e.js 20 bytes [built]
170+
chunk {3} default/async-b.js (async-b) 112 bytes <{5}> ={0}= [rendered]
171+
> ./b [8] ./index.js 2:0-47
172+
[0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built]
173+
[1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built]
174+
[4] ./b.js 72 bytes {3} {7} [built]
175+
chunk {4} default/async-c.js (async-c) 112 bytes <{5}> ={0}= [rendered]
176+
> ./c [8] ./index.js 3:0-47
177+
[0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built]
178+
[1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built]
179+
[5] ./c.js 72 bytes {4} {8} [built]
180+
chunk {5} default/main.js (main) 147 bytes >{0}< >{2}< >{3}< >{4}< [entry] [rendered]
181+
> ./ main
182+
[8] ./index.js 147 bytes {5} [built]
183+
chunk {6} default/a.js (a) 176 bytes ={0}= >{1}< [entry] [rendered]
184+
> ./a a
185+
[0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built]
186+
[7] ./a.js + 1 modules 156 bytes {2} {6} [built]
187+
| ./a.js 121 bytes [built]
188+
| ./e.js 20 bytes [built]
189+
chunk {7} default/b.js (b) 112 bytes ={0}= [entry] [rendered]
190+
> ./b b
191+
[0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built]
192+
[1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built]
193+
[4] ./b.js 72 bytes {3} {7} [built]
194+
chunk {8} default/c.js (c) 112 bytes ={0}= [entry] [rendered]
195+
> ./c c
196+
[0] ./d.js 20 bytes {2} {3} {4} {6} {7} {8} [built]
197+
[1] ./f.js 20 bytes {1} {3} {4} {7} {8} [built]
198+
[5] ./c.js 72 bytes {4} {8} [built]

test/statsCases/split-chunks/webpack.config.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,34 @@ module.exports = [
4646
}
4747
},
4848
stats
49+
},
50+
{
51+
name: "manual",
52+
mode: "production",
53+
entry: {
54+
main: "./",
55+
a: "./a",
56+
b: "./b",
57+
c: "./c",
58+
vendors: ["x", "y", "z"]
59+
},
60+
output: {
61+
filename: "default/[name].js"
62+
},
63+
optimization: {
64+
splitChunks: {
65+
minSize: 0, // enforce all,
66+
chunks: "all",
67+
cacheGroups: {
68+
default: false,
69+
vendors: {
70+
test: "vendors",
71+
name: "vendors",
72+
enforce: true
73+
}
74+
}
75+
}
76+
},
77+
stats
4978
}
5079
];

0 commit comments

Comments
 (0)