Commit 7e2a08b9 authored by Jirat Ki's avatar Jirat Ki Committed by Dan Abramov
Browse files

Strip filename from loader notation first (#1226)

parent 308121da
No related merge requests found
Showing with 6 additions and 6 deletions
+6 -6
......@@ -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
......@@ -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 = [
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment