chore: split chunks (#35222)

* chore: split chunks

* chore: update bisheng version

* chore: split @ant-design/icon

* chore: code clean

* chore: test

* chore: split moment

* chore: code clean
This commit is contained in:
MadCcc 2022-05-08 09:48:30 +08:00 committed by GitHub
parent 11e2ce6c01
commit 8b682a5662
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

View File

@ -187,7 +187,7 @@
"antd-img-crop": "^4.0.0",
"array-move": "^4.0.0",
"babel-plugin-add-react-displayname": "^0.0.5",
"bisheng": "^3.2.1",
"bisheng": "^3.3.0",
"bisheng-plugin-description": "^0.1.4",
"bisheng-plugin-react": "^1.2.0",
"bisheng-plugin-toc": "^0.4.4",

View File

@ -161,6 +161,31 @@ module.exports = {
];
}
// Split chunks
config.optimization.splitChunks = {
...config.optimization.splitChunks,
cacheGroups: {
vendors: {
test: /[/\\]node_modules[/\\]@ant-design[/\\]icon/,
name: 'anticon',
chunks: 'initial',
maxSize: 1024 * 1024,
},
components: {
test(module) {
return (
module.resource &&
module.resource.includes('ant-design/components') &&
!module.resource.includes('demo') &&
!module.resource.endsWith('md')
);
},
name: 'components',
chunks: 'initial',
},
},
};
return config;
},