Merge pull request #6892 from jeremenichelli/clearer-mode-warning

fix: better no mode warning message
This commit is contained in:
Sean Larkin 2018-03-28 19:12:42 -05:00 committed by GitHub
commit 17034eb61c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -13,8 +13,10 @@ module.exports = class NoModeWarning extends WebpackError {
this.name = "NoModeWarning";
this.message =
"configuration\n" +
"The 'mode' option has not been set. " +
"Set 'mode' option to 'development' or 'production' to enable defaults for this environment. ";
"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/";
Error.captureStackTrace(this, this.constructor);
}

View File

@ -1,4 +1,4 @@
Hash: 885948e5541fff6e85ac
Hash: 550499db0a071b393308
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
@ -8,7 +8,8 @@ Entrypoint main = bundle.js
[0] ./index.js 0 bytes {0} [built]
WARNING in configuration
The 'mode' option has not been set. Set 'mode' option to 'development' or 'production' to enable defaults for this environment.
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/
Child child:
Asset Size Chunks Chunk Names
child.js 2.61 KiB 0 child