Merge pull request #7429 from webpack/test/issue-7401

add test cases for #7401
This commit is contained in:
Tobias Koppers 2018-05-29 13:51:08 +02:00 committed by GitHub
commit 4fc3981304
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 52 additions and 0 deletions

View File

@ -2571,6 +2571,25 @@ chunk {3} vendors.js (vendors) 20 bytes ={2}= >{0}< >{1}< [initial] [rendered
[4] ./node_modules/y.js 20 bytes {3} [built]"
`;
exports[`StatsTestCases should print correct stats for split-chunks-issue-7401 1`] = `
"Entrypoint a = vendors~a~c.js a.js
Entrypoint b = b.js
Chunk Group c = vendors~a~c.js c.js
chunk {0} vendors~a~c.js (vendors~a~c) 20 bytes <{3}> ={1}= ={2}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~a~c)
> ./a a
> ./c [3] ./b.js 1:0-41
[0] ./node_modules/x.js 20 bytes {0} [built]
chunk {1} c.js (c) 12 bytes <{3}> ={0}= [rendered]
> ./c [3] ./b.js 1:0-41
[1] ./c.js 12 bytes {1} [built]
chunk {2} a.js (a) 12 bytes ={0}= [entry] [rendered]
> ./a a
[2] ./a.js 12 bytes {2} [built]
chunk {3} b.js (b) 43 bytes >{0}< >{1}< [entry] [rendered]
> ./b b
[3] ./b.js 43 bytes {3} [built]"
`;
exports[`StatsTestCases should print correct stats for split-chunks-prefer-bigger-splits 1`] = `
"Entrypoint main = default/main.js
chunk {0} default/async-b~async-c.js (async-b~async-c) 110 bytes <{4}> ={2}= ={3}= [rendered] split chunk (cache group: default) (name: async-b~async-c)

View File

@ -0,0 +1 @@
import "x";

View File

@ -0,0 +1 @@
import(/* webpackChunkName: "c" */ "./c");

View File

@ -0,0 +1 @@
import "x";

View File

@ -0,0 +1 @@
export default "x";

View File

@ -0,0 +1,29 @@
const stats = {
hash: false,
timings: false,
builtAt: false,
assets: false,
chunks: true,
chunkOrigins: true,
entrypoints: true,
chunkGroups: true,
modules: false
};
module.exports = {
name: "default",
mode: "production",
entry: {
a: "./a",
b: "./b"
},
output: {
filename: "[name].js"
},
optimization: {
splitChunks: {
minSize: 0, // enforce all
chunks: "all"
}
},
stats
};