Skip to content

Commit

Permalink
fix: dev broken (#35453)
Browse files Browse the repository at this point in the history
  • Loading branch information
MadCcc committed May 9, 2022
1 parent b5699cc commit 0f63293
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions site/bisheng.config.js
Expand Up @@ -162,29 +162,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')
);
if (config.mode === 'production') {
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',
},
name: 'components',
chunks: 'initial',
},
},
};
};
}

return config;
},
Expand Down

0 comments on commit 0f63293

Please sign in to comment.