Skip to content

Commit 2fe82af

Browse files
committed
Suggest course of action
1 parent 4b9b660 commit 2fe82af

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

lib/WebpackOptionsValidationError.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,12 @@ class WebpackOptionsValidationError extends Error {
181181
else
182182
return `${dataPath} ${err.message}`;
183183
} else if(err.keyword === "absolutePath") {
184-
return `${dataPath}: ${err.message}`;
184+
const baseMessage = `${dataPath}: ${err.message}`;
185+
if(dataPath === "configuration.output.filename") {
186+
return `${baseMessage}\n` +
187+
"Please use output.path to specify absolute path and output.filename for the file name.";
188+
}
189+
return baseMessage;
185190
} else {
186191
// eslint-disable-line no-fallthrough
187192
return `${dataPath} ${err.message} (${JSON.stringify(err, 0, 2)}).\n${getSchemaPartText(err.parentSchema)}`;

test/Validation.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ describe("Validation", () => {
185185
},
186186
message: [
187187
" - configuration.output.filename: A relative path is expected. However the provided value \"/bar\" is an absolute path!",
188+
" Please use output.path to specify absolute path and output.filename for the file name."
188189
]
189190
}, {
190191
name: "absolute path",

0 commit comments

Comments
 (0)