From 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 18 Jun 2020 11:18:50 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-1-stable-ee --- config/webpack.config.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'config/webpack.config.js') diff --git a/config/webpack.config.js b/config/webpack.config.js index 7c130b010b6..557db58b1b9 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -19,10 +19,11 @@ const IS_EE = require('./helpers/is_ee_env'); const DEV_SERVER_HOST = process.env.DEV_SERVER_HOST || 'localhost'; const DEV_SERVER_PORT = parseInt(process.env.DEV_SERVER_PORT, 10) || 3808; const DEV_SERVER_LIVERELOAD = IS_DEV_SERVER && process.env.DEV_SERVER_LIVERELOAD !== 'false'; -const WEBPACK_REPORT = process.env.WEBPACK_REPORT; -const WEBPACK_MEMORY_TEST = process.env.WEBPACK_MEMORY_TEST; -const NO_COMPRESSION = process.env.NO_COMPRESSION; -const NO_SOURCEMAPS = process.env.NO_SOURCEMAPS; +const WEBPACK_REPORT = process.env.WEBPACK_REPORT && process.env.WEBPACK_REPORT !== 'false'; +const WEBPACK_MEMORY_TEST = + process.env.WEBPACK_MEMORY_TEST && process.env.WEBPACK_MEMORY_TEST !== 'false'; +const NO_COMPRESSION = process.env.NO_COMPRESSION && process.env.NO_COMPRESSION !== 'false'; +const NO_SOURCEMAPS = process.env.NO_SOURCEMAPS && process.env.NO_SOURCEMAPS !== 'false'; const VUE_VERSION = require('vue/package.json').version; const VUE_LOADER_VERSION = require('vue-loader/package.json').version; @@ -244,6 +245,7 @@ module.exports = { loader: 'file-loader', options: { name: '[name].[contenthash:8].[ext]', + esModule: false, }, }, ], @@ -254,7 +256,7 @@ module.exports = { moduleIds: 'hashed', runtimeChunk: 'single', splitChunks: { - maxInitialRequests: 4, + maxInitialRequests: 20, cacheGroups: { default: false, common: () => ({ @@ -329,9 +331,6 @@ module.exports = { // automatically configure monaco editor web workers new MonacoWebpackPlugin(), - // prevent pikaday from including moment.js - new webpack.IgnorePlugin(/moment/, /pikaday/), - // fix legacy jQuery plugins which depend on globals new webpack.ProvidePlugin({ $: 'jquery', @@ -516,6 +515,14 @@ module.exports = { // This one is used to check against "EE" properly in application code IS_EE: IS_EE ? 'window.gon && window.gon.ee' : JSON.stringify(false), }), + + /* Pikaday has a optional dependency to moment. + We are currently not utilizing moment. + Ignoring this import removes warning from our development build. + Upstream reference: + https://github.com/Pikaday/Pikaday/blob/5c1a7559be/pikaday.js#L14 + */ + new webpack.IgnorePlugin(/moment/, /pikaday/), ].filter(Boolean), devServer: { -- cgit v1.2.3