Skip to content
This repository was archived by the owner on Jul 27, 2021. It is now read-only.

Commit 7820f16

Browse files
committed
Remove loaders from file displayed
1 parent b27920f commit 7820f16

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/formatters/defaultError.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function displayError(severity, error) {
77
const baseError = formatTitle(severity, severity);
88

99
return concat(
10-
`${baseError} ${error.file ? 'in ' + error.file : ''}`,
10+
`${baseError} ${removeLoaders(error.file)}`,
1111
'',
1212
error.message,
1313
(error.origin ? error.origin : undefined),
@@ -16,6 +16,15 @@ function displayError(severity, error) {
1616
);
1717
}
1818

19+
function removeLoaders(file) {
20+
if (!file) {
21+
return "";
22+
}
23+
const split = file.split('!');
24+
const filePath = split[split.length - 1];
25+
return `in ${filePath}`;
26+
}
27+
1928
function isDefaultError(error) {
2029
return !error.type;
2130
}

0 commit comments

Comments
 (0)