Skip to content

Commit

Permalink
Strip filename from loader notation first (#1226)
Browse files Browse the repository at this point in the history
  • Loading branch information
n3tr authored and gaearon committed Dec 10, 2016
1 parent 308121d commit 7e2a08b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/react-dev-utils/formatWebpackMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ function isLikelyASyntaxError(message) {
function formatMessage(message) {
var lines = message.split('\n');

// line #0 is filename
// line #1 is the main error message
if (!lines[0] || !lines[1]) {
return message;
}

// Remove webpack-specific loader notation from filename.
// Before:
// ./~/css-loader!./~/postcss-loader!./src/App.css
Expand All @@ -39,6 +33,12 @@ function formatMessage(message) {
lines[0] = lines[0].substr(lines[0].lastIndexOf('!') + 1);
}

// line #0 is filename
// line #1 is the main error message
if (!lines[0] || !lines[1]) {
return lines.join('\n');
}

// Cleans up verbose "module not found" messages for files and packages.
if (lines[1].indexOf('Module not found: ') === 0) {
lines = [
Expand Down

0 comments on commit 7e2a08b

Please sign in to comment.