diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /config/webpack.config.js | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'config/webpack.config.js')
-rw-r--r-- | config/webpack.config.js | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/config/webpack.config.js b/config/webpack.config.js index e220482d769..7c130b010b6 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -141,8 +141,8 @@ module.exports = { output: { path: path.join(ROOT_PATH, 'public/assets/webpack'), publicPath: '/assets/webpack/', - filename: IS_PRODUCTION ? '[name].[chunkhash:8].bundle.js' : '[name].bundle.js', - chunkFilename: IS_PRODUCTION ? '[name].[chunkhash:8].chunk.js' : '[name].chunk.js', + filename: IS_PRODUCTION ? '[name].[contenthash:8].bundle.js' : '[name].bundle.js', + chunkFilename: IS_PRODUCTION ? '[name].[contenthash:8].chunk.js' : '[name].chunk.js', globalObject: 'this', // allow HMR and web workers to play nice }, @@ -191,7 +191,7 @@ module.exports = { test: /icons\.svg$/, loader: 'file-loader', options: { - name: '[name].[hash:8].[ext]', + name: '[name].[contenthash:8].[ext]', }, }, { @@ -210,7 +210,7 @@ module.exports = { { loader: 'worker-loader', options: { - name: '[name].[hash:8].worker.js', + name: '[name].[contenthash:8].worker.js', inline: IS_DEV_SERVER, }, }, @@ -222,7 +222,7 @@ module.exports = { exclude: /node_modules/, loader: 'file-loader', options: { - name: '[name].[hash:8].[ext]', + name: '[name].[contenthash:8].[ext]', }, }, { @@ -232,7 +232,8 @@ module.exports = { { loader: 'css-loader', options: { - name: '[name].[hash:8].[ext]', + modules: 'global', + localIdentName: '[name].[contenthash:8].[ext]', }, }, ], @@ -242,13 +243,15 @@ module.exports = { include: /node_modules\/katex\/dist\/fonts/, loader: 'file-loader', options: { - name: '[name].[hash:8].[ext]', + name: '[name].[contenthash:8].[ext]', }, }, ], }, optimization: { + // Replace 'hashed' with 'deterministic' in webpack 5 + moduleIds: 'hashed', runtimeChunk: 'single', splitChunks: { maxInitialRequests: 4, @@ -260,6 +263,30 @@ module.exports = { chunks: 'initial', minChunks: autoEntriesCount * 0.9, }), + monaco: { + priority: 15, + name: 'monaco', + chunks: 'initial', + test: /[\\/]node_modules[\\/]monaco-editor[\\/]/, + minChunks: 2, + reuseExistingChunk: true, + }, + echarts: { + priority: 14, + name: 'echarts', + chunks: 'all', + test: /[\\/]node_modules[\\/](echarts|zrender)[\\/]/, + minChunks: 2, + reuseExistingChunk: true, + }, + security_reports: { + priority: 13, + name: 'security_reports', + chunks: 'initial', + test: /[\\/](vue_shared[\\/](security_reports|license_compliance)|security_dashboard)[\\/]/, + minChunks: 2, + reuseExistingChunk: true, + }, vendors: { priority: 10, chunks: 'async', |