Skip to content

Commit

Permalink
chore: split chunks (#35222)
Browse files Browse the repository at this point in the history
* chore: split chunks

* chore: update bisheng version

* chore: split @ant-design/icon

* chore: code clean

* chore: test

* chore: split moment

* chore: code clean
  • Loading branch information
MadCcc committed May 8, 2022
1 parent 11e2ce6 commit 8b682a5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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",
Expand Down
25 changes: 25 additions & 0 deletions site/bisheng.config.js
Expand Up @@ -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;
},

Expand Down

0 comments on commit 8b682a5

Please sign in to comment.