From cb3e6f3cf60df232250a494dd9a778053835e65f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoni=20Silvestrovi=C4=8D?= Date: Fri, 15 Mar 2019 13:02:39 +0000 Subject: [PATCH 01/15] Preset option for errors & warnings only --- lib/Stats.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Stats.js b/lib/Stats.js index 039ed5169..28dd0fba4 100644 --- a/lib/Stats.js +++ b/lib/Stats.js @@ -1408,6 +1408,12 @@ class Stats { errors: true, moduleTrace: true }; + case "errors-warnings": + return { + all: false, + errors: true, + warnings: true + }; default: return {}; } From 9192c8c36770e0ee9d88815db03233f4ab1a4784 Mon Sep 17 00:00:00 2001 From: vincentrodriguez Date: Tue, 19 Mar 2019 10:39:46 +0000 Subject: [PATCH 02/15] test case for "errors-warnings" stats preset --- test/statsCases/preset-errors-warnings/index.js | 0 test/statsCases/preset-errors-warnings/webpack.config.js | 5 +++++ 2 files changed, 5 insertions(+) create mode 100644 test/statsCases/preset-errors-warnings/index.js create mode 100644 test/statsCases/preset-errors-warnings/webpack.config.js diff --git a/test/statsCases/preset-errors-warnings/index.js b/test/statsCases/preset-errors-warnings/index.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/statsCases/preset-errors-warnings/webpack.config.js b/test/statsCases/preset-errors-warnings/webpack.config.js new file mode 100644 index 000000000..5c54a2307 --- /dev/null +++ b/test/statsCases/preset-errors-warnings/webpack.config.js @@ -0,0 +1,5 @@ +module.exports = { + mode: "production", + entry: "./index", + stats: "errors-warnings" +}; From 579d42b650c65385645ea32a980359cae8303f76 Mon Sep 17 00:00:00 2001 From: vincentrodriguez Date: Tue, 19 Mar 2019 10:49:55 +0000 Subject: [PATCH 03/15] update to support "errors-warnings" stats preset option --- declarations/WebpackOptions.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/declarations/WebpackOptions.d.ts b/declarations/WebpackOptions.d.ts index f112da0e5..612b61ce1 100644 --- a/declarations/WebpackOptions.d.ts +++ b/declarations/WebpackOptions.d.ts @@ -369,7 +369,7 @@ export interface WebpackOptions { stats?: | StatsOptions | boolean - | ("none" | "errors-only" | "minimal" | "normal" | "detailed" | "verbose"); + | ("none" | "errors-only" | "minimal" | "normal" | "detailed" | "verbose" | "errors-warnings"); /** * Environment to build for */ From 85b1eb9a4a14291aed5a2e8efb1adfe0a0dd8db2 Mon Sep 17 00:00:00 2001 From: vincentrodriguez Date: Tue, 19 Mar 2019 10:57:08 +0000 Subject: [PATCH 04/15] schema update to support "errors-warnings" preset --- schemas/WebpackOptions.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/schemas/WebpackOptions.json b/schemas/WebpackOptions.json index c7e54b83e..0bb98f9a9 100644 --- a/schemas/WebpackOptions.json +++ b/schemas/WebpackOptions.json @@ -2109,7 +2109,8 @@ "minimal", "normal", "detailed", - "verbose" + "verbose", + "errors-warnings" ] } ] From 111e86439311947161b50fa8958c39f125692616 Mon Sep 17 00:00:00 2001 From: vincentrodriguez Date: Tue, 19 Mar 2019 11:24:34 +0000 Subject: [PATCH 05/15] support for "errors-warnings" stats preset --- declarations/WebpackOptions.d.ts | 9 ++++++++- test/__snapshots__/StatsTestCases.test.js.snap | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/declarations/WebpackOptions.d.ts b/declarations/WebpackOptions.d.ts index 612b61ce1..b6ca988c8 100644 --- a/declarations/WebpackOptions.d.ts +++ b/declarations/WebpackOptions.d.ts @@ -369,7 +369,14 @@ export interface WebpackOptions { stats?: | StatsOptions | boolean - | ("none" | "errors-only" | "minimal" | "normal" | "detailed" | "verbose" | "errors-warnings"); + | ( + | "none" + | "errors-only" + | "minimal" + | "normal" + | "detailed" + | "verbose" + | "errors-warnings"); /** * Environment to build for */ diff --git a/test/__snapshots__/StatsTestCases.test.js.snap b/test/__snapshots__/StatsTestCases.test.js.snap index d441f4fb1..8f77d4f63 100644 --- a/test/__snapshots__/StatsTestCases.test.js.snap +++ b/test/__snapshots__/StatsTestCases.test.js.snap @@ -1915,6 +1915,8 @@ Module not found: Error: Can't resolve 'does-not-exist' in 'Xdir/preset-errors-o @ ./index.js 1:0-25" `; +exports[`StatsTestCases should print correct stats for preset-errors-warnings 1`] = `""`; + exports[`StatsTestCases should print correct stats for preset-minimal 1`] = `" 6 modules"`; exports[`StatsTestCases should print correct stats for preset-minimal-simple 1`] = `" 1 module"`; From 14c78ce2bd264eb8ff5e397136f90c7f069e0406 Mon Sep 17 00:00:00 2001 From: EugeneHlushko Date: Mon, 1 Apr 2019 10:56:00 +0300 Subject: [PATCH 06/15] mode(warning) update documentation link in warning --- lib/NoModeWarning.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/NoModeWarning.js b/lib/NoModeWarning.js index 1fbc3426a..4bd3c3ff8 100644 --- a/lib/NoModeWarning.js +++ b/lib/NoModeWarning.js @@ -16,7 +16,7 @@ module.exports = class NoModeWarning extends WebpackError { "The 'mode' option has not been set, webpack will fallback to 'production' for this value. " + "Set 'mode' option to 'development' or 'production' to enable defaults for each environment.\n" + "You can also set it to 'none' to disable any default behavior. " + - "Learn more: https://webpack.js.org/concepts/mode/"; + "Learn more: https://webpack.js.org/configuration/mode/"; Error.captureStackTrace(this, this.constructor); } From fe2c41ad7faba543474031717c9bf90ea97f82d8 Mon Sep 17 00:00:00 2001 From: EugeneHlushko Date: Mon, 1 Apr 2019 10:58:54 +0300 Subject: [PATCH 07/15] mode(warning) update mode warning snapshot --- test/__snapshots__/StatsTestCases.test.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/__snapshots__/StatsTestCases.test.js.snap b/test/__snapshots__/StatsTestCases.test.js.snap index d441f4fb1..c382c2b69 100644 --- a/test/__snapshots__/StatsTestCases.test.js.snap +++ b/test/__snapshots__/StatsTestCases.test.js.snap @@ -1512,7 +1512,7 @@ Entrypoint main = bundle.js WARNING in configuration The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment. -You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/ +You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/ Child child: Asset Size Chunks Chunk Names child.js 3.57 KiB 0 child From 98f8e4b375afeeb64c43e58c5d46c91cf5886695 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 12 Apr 2019 19:37:29 +0000 Subject: [PATCH 08/15] Bump react-dom from 16.8.5 to 16.8.6 Bumps [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom) from 16.8.5 to 16.8.6. - [Release notes](https://github.com/facebook/react/releases) - [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md) - [Commits](https://github.com/facebook/react/commits/v16.8.6/packages/react-dom) Signed-off-by: dependabot[bot] --- yarn.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5e3df6f85..879ed0522 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5673,14 +5673,14 @@ rc@^1.1.7: strip-json-comments "~2.0.1" react-dom@^16.8.0: - version "16.8.5" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.5.tgz#b3e37d152b49e07faaa8de41fdf562be3463335e" - integrity sha512-VIEIvZLpFafsfu4kgmftP5L8j7P1f0YThfVTrANMhZUFMDOsA6e0kfR6wxw/8xxKs4NB59TZYbxNdPCDW34x4w== + version "16.8.6" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.6.tgz#71d6303f631e8b0097f56165ef608f051ff6e10f" + integrity sha512-1nL7PIq9LTL3fthPqwkvr2zY7phIPjYrT0jp4HjyEQrEROnw4dG41VVwi/wfoCneoleqrNX7iAD+pXebJZwrwA== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" prop-types "^15.6.2" - scheduler "^0.13.5" + scheduler "^0.13.6" react-is@^16.8.4: version "16.8.5" @@ -6002,7 +6002,7 @@ sax@^1.2.4: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== -scheduler@^0.13.5, scheduler@^0.13.6: +scheduler@^0.13.6: version "0.13.6" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889" integrity sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ== From 84ca105156bd97858faa99471960e20f2f80cc23 Mon Sep 17 00:00:00 2001 From: EugeneHlushko Date: Mon, 15 Apr 2019 15:23:16 +0300 Subject: [PATCH 09/15] mode(warning) update mode warning snapshot hash --- test/__snapshots__/StatsTestCases.test.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/__snapshots__/StatsTestCases.test.js.snap b/test/__snapshots__/StatsTestCases.test.js.snap index c382c2b69..3b0138b5d 100644 --- a/test/__snapshots__/StatsTestCases.test.js.snap +++ b/test/__snapshots__/StatsTestCases.test.js.snap @@ -1501,7 +1501,7 @@ Entrypoint entry = entry.js `; exports[`StatsTestCases should print correct stats for no-emit-on-errors-plugin-with-child-error 1`] = ` -"Hash: c07d925d7e60129ffc69 +"Hash: 51d6721efa0198f0e5a4 Time: Xms Built at: Thu Jan 01 1970 00:00:00 GMT Asset Size Chunks Chunk Names From dc6dd515d3a34486b73cd394d89f85399dc6c2b1 Mon Sep 17 00:00:00 2001 From: Merijn Wijngaard Date: Thu, 18 Apr 2019 09:37:41 +0200 Subject: [PATCH 10/15] Allow top-level return in script parsing. Fixes issue 8509 in master, like PR 8510 fixed it for 'next' --- lib/Parser.js | 3 +++ test/fixtures/b.js | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Parser.js b/lib/Parser.js index a5b444eeb..3df20ce7a 100644 --- a/lib/Parser.js +++ b/lib/Parser.js @@ -2238,6 +2238,8 @@ class Parser extends Tapable { if (type === "auto") { parserOptions.sourceType = "module"; + } else if (parserOptions.sourceType === "script") { + parserOptions.allowReturnOutsideFunction = true; } let ast; @@ -2252,6 +2254,7 @@ class Parser extends Tapable { if (threw && type === "auto") { parserOptions.sourceType = "script"; + parserOptions.allowReturnOutsideFunction = true; if (Array.isArray(parserOptions.onComment)) { parserOptions.onComment.length = 0; } diff --git a/test/fixtures/b.js b/test/fixtures/b.js index 0900b0b45..7e6505aa8 100644 --- a/test/fixtures/b.js +++ b/test/fixtures/b.js @@ -1,3 +1,6 @@ module.exports = function b() { return "This is b"; -}; \ No newline at end of file +}; + +// Test CJS top-level return +return; From 022d1b737d9196c72da1e3dd5159b88fffd0b10c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 25 Apr 2019 07:08:45 +0000 Subject: [PATCH 11/15] chore(deps-dev): bump eslint-plugin-jest from 22.4.1 to 22.5.1 Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 22.4.1 to 22.5.1. - [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases) - [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/master/CHANGELOG.md) - [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v22.4.1...v22.5.1) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5e3df6f85..e5869fa9f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2196,9 +2196,9 @@ eslint-plugin-es@^1.3.1: regexpp "^2.0.0" eslint-plugin-jest@^22.2.2: - version "22.4.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-22.4.1.tgz#a5fd6f7a2a41388d16f527073b778013c5189a9c" - integrity sha512-gcLfn6P2PrFAVx3AobaOzlIEevpAEf9chTpFZz7bYfc7pz8XRv7vuKTIE4hxPKZSha6XWKKplDQ0x9Pq8xX2mg== + version "22.5.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-22.5.1.tgz#a31dfe9f9513c6af7c17ece4c65535a1370f060b" + integrity sha512-c3WjZR/HBoi4GedJRwo2OGHa8Pzo1EbSVwQ2HFzJ+4t2OoYM7Alx646EH/aaxZ+9eGcPiq0FT0UGkRuFFx2FHg== eslint-plugin-node@^8.0.0: version "8.0.1" From 084ca0b10dcae56f9650c2f2cebc811bc64608fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 25 Apr 2019 16:26:30 +0000 Subject: [PATCH 12/15] chore(deps-dev): bump eslint-config-prettier from 4.1.0 to 4.2.0 Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 4.1.0 to 4.2.0. - [Release notes](https://github.com/prettier/eslint-config-prettier/releases) - [Changelog](https://github.com/prettier/eslint-config-prettier/blob/master/CHANGELOG.md) - [Commits](https://github.com/prettier/eslint-config-prettier/compare/v4.1.0...v4.2.0) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5e3df6f85..89470e565 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2181,9 +2181,9 @@ escodegen@^1.9.1: source-map "~0.6.1" eslint-config-prettier@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-4.1.0.tgz#181364895899fff9fd3605fecb5c4f20e7d5f395" - integrity sha512-zILwX9/Ocz4SV2vX7ox85AsrAgXV3f2o2gpIicdMIOra48WYqgUnWNH/cR/iHtmD2Vb3dLSC3LiEJnS05Gkw7w== + version "4.2.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-4.2.0.tgz#70b946b629cd0e3e98233fd9ecde4cb9778de96c" + integrity sha512-y0uWc/FRfrHhpPZCYflWC8aE0KRJRY04rdZVfl8cL3sEZmOYyaBdhdlQPjKZBnuRMyLVK+JUZr7HaZFClQiH4w== dependencies: get-stdin "^6.0.0" From 5800043c3e3b87c726a5f03ad9edc441f2cd6ba2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 8 May 2019 00:48:24 +0000 Subject: [PATCH 13/15] chore(deps-dev): bump glob from 7.1.3 to 7.1.4 Bumps [glob](https://github.com/isaacs/node-glob) from 7.1.3 to 7.1.4. - [Release notes](https://github.com/isaacs/node-glob/releases) - [Changelog](https://github.com/isaacs/node-glob/blob/master/changelog.md) - [Commits](https://github.com/isaacs/node-glob/compare/v7.1.3...v7.1.4) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5e3df6f85..8d81f946f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2807,9 +2807,9 @@ glob@^5.0.15: path-is-absolute "^1.0.0" glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + version "7.1.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" + integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" From 13045f1cd2f284f495b4558daba5c56976f09182 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 8 May 2019 08:18:14 +0000 Subject: [PATCH 14/15] chore(deps-dev): bump simple-git from 1.110.0 to 1.113.0 Bumps [simple-git](https://github.com/steveukx/git-js) from 1.110.0 to 1.113.0. - [Release notes](https://github.com/steveukx/git-js/releases) - [Commits](https://github.com/steveukx/git-js/compare/v1.110.0...v1.113.0) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5e3df6f85..262b35f6b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6149,9 +6149,9 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= simple-git@^1.65.0, simple-git@^1.85.0: - version "1.110.0" - resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-1.110.0.tgz#54eb179089d055a7783d32399246cebc9d9933e9" - integrity sha512-UYY0rQkknk0P5eb+KW+03F4TevZ9ou0H+LoGaj7iiVgpnZH4wdj/HTViy/1tNNkmIPcmtxuBqXWiYt2YwlRKOQ== + version "1.113.0" + resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-1.113.0.tgz#668989728a1e9cf4ec6c72b69ea2eecc93489bea" + integrity sha512-i9WVsrK2u0G/cASI9nh7voxOk9mhanWY9eGtWBDSYql6m49Yk5/Fan6uZsDr/xmzv8n+eQ8ahKCoEr8cvU3h+g== dependencies: debug "^4.0.1" From 2e1e1799b1fc56b68dbddbe8712ff6393654ccbd Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Thu, 9 May 2019 09:56:20 +0200 Subject: [PATCH 15/15] 4.31.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 75354056c..3a523ef05 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webpack", - "version": "4.30.0", + "version": "4.31.0", "author": "Tobias Koppers @sokra", "description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.", "license": "MIT",