Skip to content

Commit

Permalink
Make Sass missing message friendlier (#4514)
Browse files Browse the repository at this point in the history
* Tweak browser support section

* Make sass message friendlier

* Tweak message

* Tweak message futher

* test
  • Loading branch information
Timer authored Sep 26, 2018
1 parent bfb17b2 commit 1448b24
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/react-dev-utils/formatWebpackMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ function formatMessage(message, isError) {
];
}

if (lines[1].match(/Cannot find module.+node-sass/)) {
lines[1] =
'To import Sass files in this project, you need to install node-sass.\n';
lines[1] +=
'Please run `npm i node-sass --save` or `yarn add node-sass` inside your workspace.';
}

// Cleans up syntax error messages.
if (lines[1].indexOf('Module build failed: ') === 0) {
lines[1] = lines[1].replace(
Expand Down

0 comments on commit 1448b24

Please sign in to comment.