Skip to content

Commit f071986

Browse files
authoredJan 18, 2018
Remove duplicated stack from thread-loader (facebook#3847)
1 parent ee2dd27 commit f071986

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
 

‎packages/react-dev-utils/formatWebpackMessages.js

+15
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,21 @@ function formatMessage(message, isError) {
4040
lines[0] = lines[0].substr(lines[0].lastIndexOf('!') + 1);
4141
}
4242

43+
// Remove unnecessary stack added by `thread-loader`
44+
var threadLoaderIndex = -1;
45+
lines.forEach(function(line, index) {
46+
if (threadLoaderIndex !== -1) {
47+
return;
48+
}
49+
if (line.indexOf('from thread-loader (worker') !== -1) {
50+
threadLoaderIndex = index;
51+
}
52+
});
53+
54+
if (threadLoaderIndex !== -1) {
55+
lines = lines.slice(0, threadLoaderIndex);
56+
}
57+
4358
lines = lines.filter(function(line) {
4459
// Webpack adds a list of entry points to warning messages:
4560
// @ ./src/index.js

0 commit comments

Comments
 (0)
Please sign in to comment.