我搭建的是一个单页应用想用webpack4下的splitChunks功能想将node_modules引用的模块比如vue之类的提取放到一个js文件下但是怎么提都提不出来一点反应都没有,这是怎么回事?optimization:{splitChunks:{chunks:'initial',//默认只作用于异步模块,为`all`时对所有模块生效,`initial`对同步模块有效minSize:30000,//合并前模块文件的体积minChunks:1,//最少被引用次数maxAsyncRequests:5,maxInitialRequests:3,automaticNameDelimiter:'~',cacheGroups:{vendors:{test:/node_modules/,minChunks:1,priority:-10},default:{test:/src/,minChunks:2,priority:-20,reuseExistingChunk:true}}}},
2 回答
MM们
TA贡献1886条经验 获得超2个赞
splitChunks:{cacheGroups:{manifest:{name:"manifest",chunks:"initial",minChunks:2},vendor:{chunks:"all",test:/[\\/]node_modules[\\/]/,name:"vendor",minChunks:1,maxInitialRequests:5,minSize:0,priority:98}}}},
添加回答
举报
0/150
提交
取消