Skip to content

Commit 9f9144e

Browse files
committed
added another custom error message for the debug property
1 parent 259cf68 commit 9f9144e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

lib/WebpackOptionsValidationError.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ WebpackOptionsValidationError.formatValidationError = function formatValidationE
2727
var baseMessage = dataPath + " has an unknown property '" + err.params.additionalProperty + "'. These properties are valid:\n" +
2828
getSchemaPartText(err.parentSchema);
2929
if(!err.dataPath) {
30+
switch(err.params.additionalProperty) {
31+
case "debug":
32+
return baseMessage + "\n" +
33+
"The 'debug' property was removed in webpack 2.\n" +
34+
"Loaders should be updated to allow passing this option via loader options in module.rules.\n" +
35+
"Until loaders are updated one can use the LoaderOptionsPlugin to switch loaders into debug mode:\n" +
36+
"plugins: {\n" +
37+
" new webpack.LoaderOptionsPlugin({\n" +
38+
" debug: true\n" +
39+
" })\n" +
40+
"}";
41+
}
3042
return baseMessage + "\n" +
3143
"For typos: please correct them.\n" +
3244
"For loader options: webpack 2 no longer allows custom properties in configuration.\n" +

0 commit comments

Comments
 (0)