@@ -82,5 +82,20 @@ module.exports={
filename:"index.html",
chunks:['index'],
}),
- ]
+ ],
+ // 优化配置(如代码拆分)
+ optimization: {
+ splitChunks: {
+ chunks: 'all',
+ minSize: 20000,
+ cacheGroups: {
+ vendors: {
+ test: /[\\/]node_modules[\\/]/,
+ priority: -10,
+ reuseExistingChunk: true,
+ name: 'vendors'
+ }
}