Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Meta
create-react-app
Commits
7e2a08b9
Commit
7e2a08b9
authored
8 years ago
by
Jirat Ki
Committed by
Dan Abramov
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Strip filename from loader notation first (#1226)
parent
308121da
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/react-dev-utils/formatWebpackMessages.js
+6
-6
packages/react-dev-utils/formatWebpackMessages.js
with
6 additions
and
6 deletions
+6
-6
packages/react-dev-utils/formatWebpackMessages.js
+
6
-
6
View file @
7e2a08b9
...
...
@@ -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
=
[
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets