@@ -25,29 +25,35 @@ module.exports = {
2525 } ) ,
2626 ] ,
2727 optimization : {
28- splitChunks : {
29- chunks : "all" ,
30- name : false ,
31- minSize : 0 ,
32- cacheGroups : {
33- commons : {
34- minChunks : 2 , //表示被引用次数,默认为1;
35- maxInitialRequests : 5 , //最大的初始化加载次数,默认为 3;
36- minSize : 0 , // 模块的文件体积超过 0 byte就抽取到common中
37- name : 'chunk-commons' , //抽取出来文件的名字,默认为 true,表示自动生成文件名
38- } ,
39- elementUI : {
40- name : "chunk-element-ui" , // 单独将 elementUI 拆包
41- priority : 20 , // 权重要大于 libs 和 app 不然会被打包进 libs 或者 app
42- test : / [ \\ / ] n o d e _ m o d u l e s [ \\ / ] e l e m e n t - u i [ \\ / ] / ,
43- } ,
44- mxgraph : {
45- name : "chunk-mxgraph" , // 单独将 elementUI 拆包
46- priority : 20 , // 权重要大于 libs 和 app 不然会被打包进 libs 或者 app
47- test : / [ \\ / ] n o d e _ m o d u l e s [ \\ / ] m x g r a p h [ \\ / ] / ,
48- } ,
49- }
50- } ,
28+ // splitChunks: {
29+ // chunks: "all",
30+ // cacheGroups: {
31+ // common: {
32+ // name: 'chunk-common',
33+ // test: /[\\/]node_modules[\\/]/,
34+ // priority: 10,
35+ // minChunks: 1,
36+ // chunks: 'all',
37+ // },
38+ // elementUI: {
39+ // name: "chunk-element-ui", // 单独将 elementUI 拆包
40+ // priority: 20, // 权重要大于 libs 和 app 不然会被打包进 libs 或者 app
41+ // test: /[\\/]node_modules[\\/]element-ui[\\/]/,
42+ // },
43+ // mxgraph: {
44+ // name: "chunk-mxgraph", // 单独将 elementUI 拆包
45+ // priority: 20, // 权重要大于 libs 和 app 不然会被打包进 libs 或者 app
46+ // test: /[\\/]node_modules[\\/]mxgraph[\\/]/,
47+ // },
48+ // component: {
49+ // name: 'chunk-componentaa',
50+ // test: /[\\/]src[\\/]/,
51+ // priority: 50,
52+ // minChunks: 1,
53+ // chunks: 'all',
54+ // },
55+ // }
56+ // },
5157 minimizer : [ new UglifyJsPlugin (
5258 {
5359 uglifyOptions : {
0 commit comments