Skip to content

Commit

Permalink
Add additional information for postcss errors (#6282) (#6352)
Browse files Browse the repository at this point in the history
* Add additional information for postcss errors

* Add additional information for postcss errors (simplify)

* Remove chunkname from postCSS compile error

* Remove line number from postCSS compile error
  • Loading branch information
buildbreakdo authored and iansu committed Oct 23, 2019
1 parent ea34c1d commit a351750
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/react-scripts/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,18 @@ function build(previousFileSizes) {
if (!err.message) {
return reject(err);
}

let errMessage = err.message;

// Add additional information for postcss errors
if (err.hasOwnProperty('postcssNode')) {
errMessage +=
'\nCompileError: Begins at CSS selector ' +
err['postcssNode'].selector;
}

messages = formatWebpackMessages({
errors: [err.message],
errors: [errMessage],
warnings: [],
});
} else {
Expand Down

0 comments on commit a351750

Please sign in to comment.