webpack打包分包注意点
1. priority 优先级,数字越⼤越优先
// 打包时候切分node_module三⽅包,以及common公⽤包
splitChunks: {
maxInitialRequests: 10,
cacheGroups: {
expressioneditor: {
test: /[\\/]expression-editor|codemirror[\\/]/,
name: 'expressioneditor',
minSize: 30000,
minChunks: 1,
chunks: 'initial',
priority: 2
},
editormodules: {
test: /[\\/]js-beautify|vuedraggable|sortablejs[\\/]/,
name: 'editormodules',
minSize: 30000,
minChunks: 1,
chunks: 'initial',
priority: 2
},
mobilemodules: {
test: /[\\/](vant|smui-form-library|quill)[\\/]/,
name: 'mobilemodules',
webpack打包流程 面试minSize: 30000,
minChunks: 1,
chunks: 'initial',
priority: 2
},
southgisui: {
test: /[\\/]southgisui[\\/]/,
name: 'southgisui',
minSize: 30000,
minChunks: 1,
chunks: 'initial',
priority: 2
},
commonmodules: {
// 将更新频繁的库统⼀放到business.js⽂件中
test: /[\\/](btnfuncs|fpautils)[\\/]/,
name: 'commonmodules',
minSize: 30000,
minChunks: 1,
chunks: 'initial',
priority: 2
},
sguiform: {
// 将更新频繁的库统⼀放到business.js⽂件中
test: /[\\/](sgui-form|sguifilepreview)[\\/]/,
name: 'sguiform',
minSize: 30000,
minChunks: 1,
chunks: 'initial',
priority: 2
},
jqueryModule: {
test: /[\\/]jquery[\\/]/,
name: 'jqueryModule',
minSize: 30000,
minChunks: 1,
chunks: 'initial',
priority: 2 // 该配置项是设置处理的优先级,数值越⼤越优先处理
},
vueModule: {
test: /[\\/](vue|vuex)[\\/]/,

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。