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 1/5] 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 039ed5169b5..28dd0fba457 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 2/5] 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 00000000000..e69de29bb2d 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 00000000000..5c54a2307dc --- /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 3/5] 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 f112da0e527..612b61ce1e1 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 4/5] 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 c7e54b83e56..0bb98f9a907 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 5/5] 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 612b61ce1e1..b6ca988c888 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 d441f4fb19f..8f77d4f63a1 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"`;