Skip to content

Commit a9d7449

Browse files
authored
Revert "Upgrade webpack to version 5" (WordPress#27974)
* Revert "Upgrade webpack to version 5 (WordPress#26382)" This reverts commit 85eda57. * Fix the package lock file
1 parent 7d61a5c commit a9d7449

File tree

9 files changed

+1097
-724
lines changed

9 files changed

+1097
-724
lines changed

package-lock.json

+1,081-707
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@
107107
"@types/sprintf-js": "1.1.2",
108108
"@types/tinycolor2": "1.4.2",
109109
"@types/uuid": "8.3.0",
110+
"@types/webpack": "4.41.16",
111+
"@types/webpack-sources": "0.1.7",
110112
"@wordpress/babel-plugin-import-jsx-pragma": "file:packages/babel-plugin-import-jsx-pragma",
111113
"@wordpress/babel-plugin-makepot": "file:packages/babel-plugin-makepot",
112114
"@wordpress/babel-preset-default": "file:packages/babel-preset-default",
@@ -196,7 +198,7 @@
196198
"typescript": "4.0.3",
197199
"uuid": "8.3.0",
198200
"wd": "1.12.1",
199-
"webpack": "5.10.0",
201+
"webpack": "4.42.0",
200202
"webpack-bundle-analyzer": "4.2.0",
201203
"worker-farm": "1.7.0"
202204
},

packages/custom-templated-path-webpack-plugin/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"escape-string-regexp": "^1.0.5"
3232
},
3333
"peerDependencies": {
34-
"webpack": "^4.0.0 || ^5.0.0"
34+
"webpack": "^4.0.0"
3535
},
3636
"publishConfig": {
3737
"access": "public"

packages/dependency-extraction-webpack-plugin/test/__snapshots__/build.js.snap

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`Webpack \`combine-assets\` should produce expected output: Asset file should match snapshot 1`] = `"<?php return array('fileA.js' => array('dependencies' => array('lodash', 'wp-blob'), 'version' => 'c1a0364500c80987c940e1d047a1f440'), 'fileB.js' => array('dependencies' => array('wp-token-list'), 'version' => '371032d1471df7da2912fa1cd5474f64'));"`;
3+
exports[`Webpack \`combine-assets\` should produce expected output: Asset file should match snapshot 1`] = `"<?php return array('fileA.js' => array('dependencies' => array('lodash', 'wp-blob'), 'version' => 'a3da22ced6876ec052d2861d383960fc'), 'fileB.js' => array('dependencies' => array('wp-token-list'), 'version' => '1a2b3802cc39dc1a607ecc4d0b23fcb0'));"`;
44

55
exports[`Webpack \`combine-assets\` should produce expected output: External modules should match snapshot 1`] = `
66
Array [
@@ -28,7 +28,7 @@ Array [
2828
]
2929
`;
3030

31-
exports[`Webpack \`dynamic-import\` should produce expected output: Asset file should match snapshot 1`] = `"<?php return array('dependencies' => array('lodash', 'wp-blob'), 'version' => '6beab7b6d11b0d5aa173d6c30876cf75');"`;
31+
exports[`Webpack \`dynamic-import\` should produce expected output: Asset file should match snapshot 1`] = `"<?php return array('dependencies' => array('lodash', 'wp-blob'), 'version' => 'd5c613274c346f46e16ab4d320fc01e6');"`;
3232

3333
exports[`Webpack \`dynamic-import\` should produce expected output: External modules should match snapshot 1`] = `
3434
Array [
@@ -48,7 +48,7 @@ Array [
4848
]
4949
`;
5050

51-
exports[`Webpack \`function-output-filename\` should produce expected output: Asset file should match snapshot 1`] = `"<?php return array('dependencies' => array('lodash', 'wp-blob'), 'version' => 'b3f0507c52ecec25e3fd43e9c24a2686');"`;
51+
exports[`Webpack \`function-output-filename\` should produce expected output: Asset file should match snapshot 1`] = `"<?php return array('dependencies' => array('lodash', 'wp-blob'), 'version' => 'f6dc46e27c3a9e7338ed4fa9fdf8f606');"`;
5252

5353
exports[`Webpack \`function-output-filename\` should produce expected output: External modules should match snapshot 1`] = `
5454
Array [
@@ -68,15 +68,15 @@ Array [
6868
]
6969
`;
7070

71-
exports[`Webpack \`no-default\` should produce expected output: Asset file should match snapshot 1`] = `"<?php return array('dependencies' => array(), 'version' => '8496c3a9f730be0cb9c1d98a4dccf779');"`;
71+
exports[`Webpack \`no-default\` should produce expected output: Asset file should match snapshot 1`] = `"<?php return array('dependencies' => array(), 'version' => '0a2f4c4cfbc33dde065a2e4be1e6337c');"`;
7272

7373
exports[`Webpack \`no-default\` should produce expected output: External modules should match snapshot 1`] = `Array []`;
7474

75-
exports[`Webpack \`no-deps\` should produce expected output: Asset file should match snapshot 1`] = `"<?php return array('dependencies' => array(), 'version' => 'edf63f92d4912e4dc86233ff82ab4eff');"`;
75+
exports[`Webpack \`no-deps\` should produce expected output: Asset file should match snapshot 1`] = `"<?php return array('dependencies' => array(), 'version' => 'e8e65570823ee9206bdada3a0f11b610');"`;
7676

7777
exports[`Webpack \`no-deps\` should produce expected output: External modules should match snapshot 1`] = `Array []`;
7878

79-
exports[`Webpack \`output-format-json\` should produce expected output: Asset file should match snapshot 1`] = `"{\\"dependencies\\":[\\"lodash\\"],\\"version\\":\\"0cc76fc6a71a3027053c3fe635f4026a\\"}"`;
79+
exports[`Webpack \`output-format-json\` should produce expected output: Asset file should match snapshot 1`] = `"{\\"dependencies\\":[\\"lodash\\"],\\"version\\":\\"aeb5066a5e17aea01932c77baf342372\\"}"`;
8080

8181
exports[`Webpack \`output-format-json\` should produce expected output: External modules should match snapshot 1`] = `
8282
Array [
@@ -88,7 +88,7 @@ Array [
8888
]
8989
`;
9090

91-
exports[`Webpack \`overrides\` should produce expected output: Asset file should match snapshot 1`] = `"<?php return array('dependencies' => array('wp-blob', 'wp-script-handle-for-rxjs', 'wp-url'), 'version' => '18b6bab716b493f09a08360d4a7da0e4');"`;
91+
exports[`Webpack \`overrides\` should produce expected output: Asset file should match snapshot 1`] = `"<?php return array('dependencies' => array('wp-blob', 'wp-script-handle-for-rxjs', 'wp-url'), 'version' => '67d711ce8940ddb82e7f264f61a5a3d9');"`;
9292

9393
exports[`Webpack \`overrides\` should produce expected output: External modules should match snapshot 1`] = `
9494
Array [
@@ -124,7 +124,7 @@ Array [
124124
]
125125
`;
126126

127-
exports[`Webpack \`wordpress\` should produce expected output: Asset file should match snapshot 1`] = `"<?php return array('dependencies' => array('lodash', 'wp-blob'), 'version' => 'b3f0507c52ecec25e3fd43e9c24a2686');"`;
127+
exports[`Webpack \`wordpress\` should produce expected output: Asset file should match snapshot 1`] = `"<?php return array('dependencies' => array('lodash', 'wp-blob'), 'version' => '202b3ce17cfd72799ce45e7efa04d83c');"`;
128128

129129
exports[`Webpack \`wordpress\` should produce expected output: External modules should match snapshot 1`] = `
130130
Array [
@@ -144,7 +144,7 @@ Array [
144144
]
145145
`;
146146

147-
exports[`Webpack \`wordpress-require\` should produce expected output: Asset file should match snapshot 1`] = `"<?php return array('dependencies' => array('lodash', 'wp-blob'), 'version' => 'f6db2e391b22a13b164814dfb5842d3f');"`;
147+
exports[`Webpack \`wordpress-require\` should produce expected output: Asset file should match snapshot 1`] = `"<?php return array('dependencies' => array('lodash', 'wp-blob'), 'version' => '47b0c1540a1caf08b8931e4a4328db04');"`;
148148

149149
exports[`Webpack \`wordpress-require\` should produce expected output: External modules should match snapshot 1`] = `
150150
Array [

packages/library-export-default-webpack-plugin/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"webpack-sources": "^1.1.0"
3434
},
3535
"peerDependencies": {
36-
"webpack": "^4.0.0 || ^5.0.0"
36+
"webpack": "^4.0.0"
3737
},
3838
"publishConfig": {
3939
"access": "public"

packages/scripts/CHANGELOG.md

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
### Breaking Changes
66

77
- The bundled `jest` dependency has been updated to the next major version `^26.6.3` (see [Breaking Changes](https://jestjs.io/blog/2020/05/05/jest-26), [#27956](https://github.com/WordPress/gutenberg/pull/27956)).
8-
- The bundled `webpack` dependency has been updated to the next major version `^5.10.0` (see [Breaking Changes](https://webpack.js.org/migrate/5/), [#26382](https://github.com/WordPress/gutenberg/pull/26382)).
98
- The bundled `@wordpress/eslint-plugin` dependency has been updated to the next major version `^8.0.0`. There are new ESLint rules enabled in the recommended config used by `lint-js` command.
109
- The bundled `stylelint-config-wordpress` dependency has been replaced with `@wordpress/stylelint-config` (#27810)[https://github.com/WordPress/gutenberg/pull/27810].
1110

packages/scripts/config/webpack.config.js

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ const cssLoaders = [
4848

4949
const config = {
5050
mode,
51-
target: 'browserslist',
5251
entry: {
5352
index: path.resolve( process.cwd(), 'src', 'index.js' ),
5453
},

packages/scripts/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@
7171
"terser-webpack-plugin": "^3.0.3",
7272
"thread-loader": "^2.1.3",
7373
"url-loader": "^3.0.0",
74-
"webpack": "^5.10.0",
74+
"webpack": "^4.42.0",
7575
"webpack-bundle-analyzer": "^4.2.0",
76-
"webpack-cli": "^4.1.0",
76+
"webpack-cli": "^3.3.11",
7777
"webpack-livereload-plugin": "^2.3.0",
7878
"webpack-sources": "^2.2.0"
7979
},

webpack.config.js

-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ module.exports = {
8787
],
8888
},
8989
mode,
90-
target: 'browserslist',
9190
entry: gutenbergPackages.reduce( ( memo, packageName ) => {
9291
const name = camelCaseDash( packageName );
9392
memo[ name ] = `./packages/${ packageName }`;

0 commit comments

Comments
 (0)