add cacheGroups
This commit is contained in:
parent
bb3e8282fc
commit
495ea523c2
@ -33,6 +33,41 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
},
|
||||
configureWebpack: config => {
|
||||
config.optimization = {
|
||||
splitChunks: {
|
||||
cacheGroups: {
|
||||
vendor: {
|
||||
chunks: 'all',
|
||||
test: /node_modules/,
|
||||
name: 'vendor',
|
||||
minChunks: 1,
|
||||
maxInitialRequests: 5,
|
||||
minSize: 0,
|
||||
priority: 100
|
||||
},
|
||||
common: {
|
||||
chunks: 'all',
|
||||
test: /[\\/]src[\\/]js[\\/]/,
|
||||
name: 'common',
|
||||
minChunks: 2,
|
||||
maxInitialRequests: 5,
|
||||
minSize: 0,
|
||||
priority: 60
|
||||
},
|
||||
styles: {
|
||||
name: 'styles',
|
||||
test: /\.(sa|sc|c)ss$/,
|
||||
chunks: 'all',
|
||||
enforce: true
|
||||
},
|
||||
runtimeChunk: {
|
||||
name: 'manifest'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
chainWebpack(config) {
|
||||
config.plugins.delete('preload')
|
||||
config.plugins.delete('prefetch')
|
||||
|
Loading…
Reference in New Issue
Block a user