优化webpack打包规则

This commit is contained in:
fofolee 2024-01-22 21:53:47 +08:00
parent c9915d4cc0
commit 7c5ce1dfab

View File

@ -92,7 +92,21 @@ module.exports = configure(function(ctx) {
},
}],
}]);
},
},
extendWebpack(cfg) {
cfg.optimization.splitChunks = {
chunks: 'all',
maxSize: 1 * 1000 * 1000,
minSize: 200 * 1000,
cacheGroups: {
vendors: {
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
chunks: 'all',
},
},
}
}
},
// Full list of options: https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js#Property%3A-devServer