Skip to content

Commit

Permalink
setup code splitting
Browse files Browse the repository at this point in the history
  • Loading branch information
kajan committed Feb 18, 2021
1 parent f58c73d commit 7fd724e
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion AspNetCoreVueMpa.Web/ClientApp/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,29 @@ module.exports = {
filename: 'css/[name].bundle.css'
}),
new CleanWebpackPlugin(),
]
],
optimization: {
runtimeChunk: 'single',
splitChunks: {
minSize: 0,
cacheGroups: {
core: {
name: 'core',
chunks: 'all',
test: /[\\/]node_modules[\\/](bootstrap-vue|vue|vuelidate|font-awesome|popper.js|portal-vue|process|regenerator-runtime|setimmediate|vue-functional-data-merge)[\\/]/,
priority: 20,
enforce: true
},
vendor: {
name: 'vendor',
chunks: 'all',
test: /[\\/]node_modules[\\/]/,
priority: 10,
enforce: true
}
}
}
}
}

if (isProduction) {
Expand Down

0 comments on commit 7fd724e

Please sign in to comment.