Skip to content

fix(deps): update dependency webpack to v5 #1874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/mc-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"terser-webpack-plugin": "4.2.3",
"thread-loader": "3.0.1",
"url-loader": "4.1.1",
"webpack": "4.44.2",
"webpack": "5.10.0",
"webpack-bundle-analyzer": "4.2.0",
"webpack-dev-server": "3.11.0",
"webpackbar": "4.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,6 @@ module.exports = ({
const LocalHtmlWebpackPlugin = require('../webpack-plugins/local-html-webpack-plugin');
return new LocalHtmlWebpackPlugin();
})(),
// Add module names to factory functions so they appear in browser profiler.
// https://webpack.js.org/guides/caching/
new webpack.NamedModulesPlugin(),
// Strip all locales except `en`, `de`
// (`en` is built into Moment and can't be removed).
new MomentLocalesPlugin({
Expand Down Expand Up @@ -185,8 +182,6 @@ module.exports = ({
strictExportPresence: true,

rules: [
// Disable require.ensure as it's not a standard language feature.
{ parser: { requireEnsure: false } },
// For svg icons, we want to get them transformed into React components
// when we import them.
{
Expand Down Expand Up @@ -355,7 +350,7 @@ module.exports = ({
{
// For all other vendor CSS, do not use "postcss" loader.
include: /node_modules/,
loaders: [
use: [
require.resolve('style-loader'),
require.resolve('css-loader'),
],
Expand Down Expand Up @@ -408,6 +403,8 @@ module.exports = ({
},
],
include: sourceFolders.concat(vendorsToTranspile),
// Disable require.ensure as it's not a standard language feature.
parser: { requireEnsure: false },
},
// Allow to import `*.graphql` SDL files.
{
Expand All @@ -417,19 +414,6 @@ module.exports = ({
},
],
},

// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
node: {
module: 'empty',
dgram: 'empty',
dns: 'mock',
fs: 'empty',
http2: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty',
},
// Turn off performance processing because we utilize
// our own hints via the FileSizeReporter
performance: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,6 @@ module.exports = ({ distPath, entryPoint, sourceFolders, toggleFlags }) => {
NODE_ENV: JSON.stringify('production'),
},
}),
// Add module names to factory functions so they appear in browser profiler.
// NOTE: instead of using `HashedModuleIdsPlugin`, we use `NamedModulesPlugin`
// for production as well, despite the `HashedModuleIdsPlugin` being the
// recommended choice for production.
// It appears that using `HashedModuleIdsPlugin` the gzipped bundles are
// bigger in size compared to the bundles produces by `NamedModulesPlugin`.
// Therefore we go for the choice of having smaller bundles.
// Refs:
// - https://gitlab.com/gitlab-org/gitlab-ce/issues/32835
// - https://medium.com/@schnibl/hashes-are-had-to-zip-pathnames-not-therefore-your-end-result-with-named-modules-is-unintuitively-94baa1a507e
new webpack.NamedModulesPlugin(),
// Strip all locales except `en`, `de`
// (`en` is built into Moment and can't be removed)
new MomentLocalesPlugin({
Expand Down Expand Up @@ -243,8 +232,6 @@ module.exports = ({ distPath, entryPoint, sourceFolders, toggleFlags }) => {
strictExportPresence: true,

rules: [
// Disable require.ensure as it's not a standard language feature.
{ parser: { requireEnsure: false } },
// For svg icons, we want to get them transformed into React components
// when we import them.
{
Expand Down Expand Up @@ -418,7 +405,7 @@ module.exports = ({ distPath, entryPoint, sourceFolders, toggleFlags }) => {
// For all other vendor CSS, do not use "postcss" loader.
// But still use MiniCssExtractPlugin :)
include: /node_modules/,
loaders: [
use: [
mergedToggleFlags.enableExtractCss
? MiniCssExtractPlugin.loader
: require.resolve('style-loader'),
Expand Down Expand Up @@ -465,6 +452,8 @@ module.exports = ({ distPath, entryPoint, sourceFolders, toggleFlags }) => {
},
],
include: sourceFolders.concat(vendorsToTranspile),
// Disable require.ensure as it's not a standard language feature.
parser: { requireEnsure: false },
},
// Allow to import `*.graphql` SDL files.
{
Expand All @@ -474,18 +463,6 @@ module.exports = ({ distPath, entryPoint, sourceFolders, toggleFlags }) => {
},
].filter(Boolean),
},
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
node: {
module: 'empty',
dgram: 'empty',
dns: 'mock',
fs: 'empty',
http2: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty',
},
// Turn off performance processing because we utilize
// our own hints via the FileSizeReporter
performance: false,
Expand Down
108 changes: 100 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5920,12 +5920,28 @@
"@types/cheerio" "*"
"@types/react" "*"

"@types/eslint-scope@^3.7.0":
version "3.7.0"
resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.0.tgz#4792816e31119ebd506902a482caec4951fabd86"
integrity sha512-O/ql2+rrCUe2W2rs7wMR+GqPRcgB6UiqN5RhrR5xruFlY7l9YLMn0ZkDzjoHLeiFkR8MCQZVudUuuvQ2BLC9Qw==
dependencies:
"@types/eslint" "*"
"@types/estree" "*"

"@types/eslint-visitor-keys@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d"
integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==

"@types/estree@*":
"@types/eslint@*":
version "7.2.6"
resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.6.tgz#5e9aff555a975596c03a98b59ecd103decc70c3c"
integrity sha512-I+1sYH+NPQ3/tVqCeUSBwTE/0heyvtXqpIopUUArlBm0Kpocb8FbMa3AZ/ASKIFpN3rnEx932TTXDbt9OXsNDw==
dependencies:
"@types/estree" "*"
"@types/json-schema" "*"

"@types/estree@*", "@types/estree@^0.0.45":
version "0.0.45"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.45.tgz#e9387572998e5ecdac221950dab3e8c3b16af884"
integrity sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g==
Expand Down Expand Up @@ -6108,7 +6124,7 @@
resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-3.12.5.tgz#136d5e6a57a931e1cce6f9d8126aa98a9c92a6bb"
integrity sha512-JCcp6J0GV66Y4ZMDAQCXot4xprYB+Zfd3meK9+INSJeVZwJmHAW30BBEEkPzXswMXuiyReUGOP3GxrADc9wPww==

"@types/json-schema@^7.0.3", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6":
"@types/json-schema@*", "@types/json-schema@^7.0.3", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6":
version "7.0.6"
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.6.tgz#f4c7ec43e81b319a9815115031709f26987891f0"
integrity sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==
Expand Down Expand Up @@ -11609,6 +11625,14 @@ enhanced-resolve@^4.3.0:
memory-fs "^0.5.0"
tapable "^1.0.0"

enhanced-resolve@^5.3.1:
version "5.4.0"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.4.0.tgz#a8bcf23b00affac9455cf71efd80844f4054f4dc"
integrity sha512-ZmqfWURB2lConOBM1JdCVfPyMRv5RdKWktLXO6123p97ovVm2CLBgw9t5MBj3jJWA6eHyOeIws9iJQoGFR4euQ==
dependencies:
graceful-fs "^4.2.4"
tapable "^2.0.0"

enquirer@^2.3.0, enquirer@^2.3.5, enquirer@^2.3.6:
version "2.3.6"
resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d"
Expand Down Expand Up @@ -12389,7 +12413,7 @@ events@^1.1.0:
resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924"
integrity sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=

events@^3.0.0:
events@^3.0.0, events@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/events/-/events-3.2.0.tgz#93b87c18f8efcd4202a461aec4dfc0556b639379"
integrity sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==
Expand Down Expand Up @@ -14561,6 +14585,11 @@ glob-to-regexp@^0.3.0:
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab"
integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=

glob-to-regexp@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e"
integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==

glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6:
version "7.1.6"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
Expand Down Expand Up @@ -17550,7 +17579,7 @@ jest-worker@^25.1.0, jest-worker@^25.4.0:
merge-stream "^2.0.0"
supports-color "^7.0.0"

jest-worker@^26.3.0, jest-worker@^26.5.0, jest-worker@^26.6.2:
jest-worker@^26.3.0, jest-worker@^26.5.0, jest-worker@^26.6.1, jest-worker@^26.6.2:
version "26.6.2"
resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed"
integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==
Expand Down Expand Up @@ -21625,7 +21654,7 @@ pixelmatch@^4.0.2:
dependencies:
pngjs "^3.0.0"

[email protected]:
[email protected], pkg-dir@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760"
integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==
Expand Down Expand Up @@ -25394,7 +25423,7 @@ source-list-map@^1.1.1:
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-1.1.2.tgz#9889019d1024cce55cdc069498337ef6186a11a1"
integrity sha1-mIkBnRAkzOVc3AaUmDN+9hhqEaE=

source-list-map@^2.0.0:
source-list-map@^2.0.0, source-list-map@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34"
integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==
Expand Down Expand Up @@ -26382,6 +26411,11 @@ tapable@^1.0.0, tapable@^1.1.3:
resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2"
integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==

tapable@^2.0.0, tapable@^2.1.1:
version "2.2.0"
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.0.tgz#5c373d281d9c672848213d0e037d1c4165ab426b"
integrity sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==

tar-fs@^2.0.0, tar-fs@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784"
Expand Down Expand Up @@ -26531,6 +26565,18 @@ terser-webpack-plugin@^2.3.8:
terser "^4.6.12"
webpack-sources "^1.4.3"

terser-webpack-plugin@^5.0.3:
version "5.0.3"
resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.0.3.tgz#ec60542db2421f45735c719d2e17dabfbb2e3e42"
integrity sha512-zFdGk8Lh9ZJGPxxPE6jwysOlATWB8GMW8HcfGULWA/nPal+3VdATflQvSBSLQJRCmYZnfFJl6vkRTiwJGNgPiQ==
dependencies:
jest-worker "^26.6.1"
p-limit "^3.0.2"
schema-utils "^3.0.0"
serialize-javascript "^5.0.1"
source-map "^0.6.1"
terser "^5.3.8"

terser@^4.1.2, terser@^4.6.12, terser@^4.6.3:
version "4.8.0"
resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17"
Expand All @@ -26540,7 +26586,7 @@ terser@^4.1.2, terser@^4.6.12, terser@^4.6.3:
source-map "~0.6.1"
source-map-support "~0.5.12"

terser@^5.2.1, terser@^5.3.4:
terser@^5.2.1, terser@^5.3.4, terser@^5.3.8:
version "5.5.1"
resolved "https://registry.yarnpkg.com/terser/-/terser-5.5.1.tgz#540caa25139d6f496fdea056e414284886fb2289"
integrity sha512-6VGWZNVP2KTUcltUQJ25TtNjx/XgdDsBDKGt8nN0MpydU36LmbPPcMBd2kmtZNNGVVDLg44k7GKeHHj+4zPIBQ==
Expand Down Expand Up @@ -27984,6 +28030,14 @@ watchpack@^1.7.4:
chokidar "^3.4.1"
watchpack-chokidar2 "^2.0.1"

watchpack@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.1.0.tgz#e63194736bf3aa22026f7b191cd57907b0f9f696"
integrity sha512-UjgD1mqjkG99+3lgG36at4wPnUXNvis2v1utwTgQ43C22c4LD71LsYMExdWXh4HZ+RmW+B0t1Vrg2GpXAkTOQw==
dependencies:
glob-to-regexp "^0.4.1"
graceful-fs "^4.1.2"

wbuf@^1.1.0, wbuf@^1.7.3:
version "1.7.3"
resolved "https://registry.yarnpkg.com/wbuf/-/wbuf-1.7.3.tgz#c1d8d149316d3ea852848895cb6a0bfe887b87df"
Expand Down Expand Up @@ -28143,6 +28197,14 @@ webpack-sources@^1.1.0, webpack-sources@^1.4.0, webpack-sources@^1.4.1, webpack-
source-list-map "^2.0.0"
source-map "~0.6.1"

webpack-sources@^2.1.1:
version "2.2.0"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-2.2.0.tgz#058926f39e3d443193b6c31547229806ffd02bac"
integrity sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w==
dependencies:
source-list-map "^2.0.1"
source-map "^0.6.1"

webpack-stats-plugin@^0.3.2:
version "0.3.2"
resolved "https://registry.yarnpkg.com/webpack-stats-plugin/-/webpack-stats-plugin-0.3.2.tgz#c06b185aa5dcc93b3f0c3a7891d24a111f849740"
Expand All @@ -28155,7 +28217,37 @@ webpack-virtual-modules@^0.2.2:
dependencies:
debug "^3.0.0"

[email protected], webpack@^4.44.1:
[email protected]:
version "5.10.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.10.0.tgz#6f77c31522a2c525152d9c344f9765d168b3df08"
integrity sha512-P0bHAXmIz0zsNcHNLqFmLY1ZtrT+jtBr7FqpuDtA2o7GiHC+zBsfhgK7SmJ1HG7BAEb3G9JoMdSVi7mEDvG3Zg==
dependencies:
"@types/eslint-scope" "^3.7.0"
"@types/estree" "^0.0.45"
"@webassemblyjs/ast" "1.9.0"
"@webassemblyjs/helper-module-context" "1.9.0"
"@webassemblyjs/wasm-edit" "1.9.0"
"@webassemblyjs/wasm-parser" "1.9.0"
acorn "^8.0.4"
browserslist "^4.14.5"
chrome-trace-event "^1.0.2"
enhanced-resolve "^5.3.1"
eslint-scope "^5.1.1"
events "^3.2.0"
glob-to-regexp "^0.4.1"
graceful-fs "^4.2.4"
json-parse-better-errors "^1.0.2"
loader-runner "^4.1.0"
mime-types "^2.1.27"
neo-async "^2.6.2"
pkg-dir "^5.0.0"
schema-utils "^3.0.0"
tapable "^2.1.1"
terser-webpack-plugin "^5.0.3"
watchpack "^2.0.0"
webpack-sources "^2.1.1"

webpack@^4.44.1:
version "4.44.2"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.44.2.tgz#6bfe2b0af055c8b2d1e90ed2cd9363f841266b72"
integrity sha512-6KJVGlCxYdISyurpQ0IPTklv+DULv05rs2hseIXer6D7KrUicRDLFb4IUM1S6LUAKypPM/nSiVSuv8jHu1m3/Q==
Expand Down