webpack splitted chuncks (vue-simple-accordion & vue-cool-lightbox)

This commit is contained in:
2021-04-06 10:42:49 +02:00
parent ca717e9abc
commit b8cdc2d64b
12 changed files with 480 additions and 145 deletions

View File

@@ -28,7 +28,8 @@ module.exports = {
},
output: {
path: utils.resolve(themePath + '/assets/dist/'),
filename: '[name].js'
filename: '[name].js',
chunkFilename: '[name].js'
},
module: {
rules: [
@@ -111,7 +112,24 @@ module.exports = {
// },
]
},
optimization: {
splitChunks: {
cacheGroups: {
vsa: {
test: /[\\/]node_modules[\\/](vue-simple-accordion)[\\/]/,
name: 'vsa',
chunks: 'all',
usedExports: true
},
vclb: {
test: /[\\/]node_modules[\\/](vue-cool-lightbox)[\\/]/,
name: 'vclb',
chunks: 'all',
usedExports: true
},
},
},
},
plugins: [
new MiniCssExtractPlugin({
filename: '[name].css'
@@ -128,6 +146,6 @@ module.exports = {
extensions: ['.js'],
paths: [utils.resolve(themePath + '/assets/dist/')],
minBytes: 4096
})
}),
]
}