Skip to content

Commit

Permalink
Tweak message futher
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer committed Sep 26, 2018
1 parent e3672fe commit 3251ef2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 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 Expand Up @@ -133,12 +140,6 @@ function formatMessage(message, isError) {
);
}

if (lines[1].match(/sass-loader.+node-sass.+install/)) {
lines[1] = 'You need to install `node-sass` to compile Sass files.\n';
lines[1] +=
'Please run `npm i node-sass` or `yarn add node-sass` inside your workspace.';
}

lines[0] = chalk.inverse(lines[0]);

// Reassemble the message.
Expand Down

0 comments on commit 3251ef2

Please sign in to comment.