优化前端

This commit is contained in:
StarsL.cn
2022-11-05 03:01:25 +08:00
parent ca0da057a2
commit 9b8fbbd6fb
3 changed files with 144 additions and 4 deletions

View File

@@ -104,6 +104,12 @@ module.exports = {
.optimization.splitChunks({
chunks: 'all',
cacheGroups: {
vue: {
name: 'chunk-vuejs',
test: /[\\/]node_modules[\\/]_?vue(.*)/,
priority: 30,
chunks: 'initial'
},
libs: {
name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/,
@@ -113,7 +119,8 @@ module.exports = {
elementUI: {
name: 'chunk-elementUI', // split elementUI into a single package
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
chunks: 'initial'
},
commons: {
name: 'chunk-commons',