Skip to content

Commit 17034eb

Browse files
authored
Merge pull request webpack#6892 from jeremenichelli/clearer-mode-warning
fix: better no mode warning message
2 parents 46de110 + 9310cea commit 17034eb

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

‎lib/NoModeWarning.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ module.exports = class NoModeWarning extends WebpackError {
1313
this.name = "NoModeWarning";
1414
this.message =
1515
"configuration\n" +
16-
"The 'mode' option has not been set. " +
17-
"Set 'mode' option to 'development' or 'production' to enable defaults for this environment. ";
16+
"The 'mode' option has not been set, webpack will fallback to 'production' for this value. " +
17+
"Set 'mode' option to 'development' or 'production' to enable defaults for each environment.\n" +
18+
"You can also set it to 'none' to disable any default behavior. " +
19+
"Learn more: https://webpack.js.org/concepts/mode/";
1820

1921
Error.captureStackTrace(this, this.constructor);
2022
}

‎test/statsCases/no-emit-on-errors-plugin-with-child-error/expected.txt‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Hash: 885948e5541fff6e85ac
1+
Hash: 550499db0a071b393308
22
Time: Xms
33
Built at: Thu Jan 01 1970 00:00:00 GMT
44
Asset Size Chunks Chunk Names
@@ -8,7 +8,8 @@ Entrypoint main = bundle.js
88
[0] ./index.js 0 bytes {0} [built]
99

1010
WARNING in configuration
11-
The 'mode' option has not been set. Set 'mode' option to 'development' or 'production' to enable defaults for this environment.
11+
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.
12+
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/
1213
Child child:
1314
Asset Size Chunks Chunk Names
1415
child.js 2.61 KiB 0 child

0 commit comments

Comments
 (0)