mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +08:00
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:
parent
11e2ce6c01
commit
8b682a5662
@ -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",
|
||||
|
@ -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;
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user