diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-07-17 13:21:46 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-07-17 13:42:09 +0300 |
commit | 01beb52e782472f2fe63ea1db1c6f7cc387c3655 (patch) | |
tree | 23066736652f981fefa290c17ce35550ed9f2f47 /webpack.common.js | |
parent | a947c1233236ae655081777fecc253635eaa817f (diff) |
Fix chunking
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'webpack.common.js')
-rw-r--r-- | webpack.common.js | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/webpack.common.js b/webpack.common.js index 3cd4f2b13..9dab63656 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -1,7 +1,7 @@ const path = require('path'); const VueLoaderPlugin = require('vue-loader/lib/plugin'); const StyleLintPlugin = require('stylelint-webpack-plugin'); - +const { CleanWebpackPlugin } = require('clean-webpack-plugin'); module.exports = { entry: { @@ -13,7 +13,7 @@ module.exports = { path: path.resolve(__dirname, './js'), publicPath: '/js/', filename: '[name].js', - chunkFilename: '[name].[chunkhash].js' + chunkFilename: '[name].js?v=[contenthash]' }, module: { rules: [ @@ -57,12 +57,26 @@ module.exports = { new VueLoaderPlugin(), new StyleLintPlugin({ files: ['src/**/*.vue', 'src/**/*.scss', 'src/**/*.css'] - }) + }), + new CleanWebpackPlugin() ], resolve: { alias: { vue$: 'vue/dist/vue.esm.js' }, extensions: ['*', '.js', '.vue', '.json'] + }, + optimization: { + splitChunks: { + cacheGroups: { + highlight: { + test: /[\\/]node_modules[\\/](hightlight\.js)[\\/]/, + }, + vendors: { + test: /[\\/]node_modules[\\/]/, + reuseExistingChunk: true + } + } + } } }; |