Unverified Commit f0719866 authored by Joe Haddad's avatar Joe Haddad Committed by GitHub
Browse files

Remove duplicated stack from `thread-loader` (#3847)

parent ee2dd27e
Showing with 15 additions and 0 deletions
+15 -0
...@@ -40,6 +40,21 @@ function formatMessage(message, isError) { ...@@ -40,6 +40,21 @@ function formatMessage(message, isError) {
lines[0] = lines[0].substr(lines[0].lastIndexOf('!') + 1); lines[0] = lines[0].substr(lines[0].lastIndexOf('!') + 1);
} }
// Remove unnecessary stack added by `thread-loader`
var threadLoaderIndex = -1;
lines.forEach(function(line, index) {
if (threadLoaderIndex !== -1) {
return;
}
if (line.indexOf('from thread-loader (worker') !== -1) {
threadLoaderIndex = index;
}
});
if (threadLoaderIndex !== -1) {
lines = lines.slice(0, threadLoaderIndex);
}
lines = lines.filter(function(line) { lines = lines.filter(function(line) {
// Webpack adds a list of entry points to warning messages: // Webpack adds a list of entry points to warning messages:
// @ ./src/index.js // @ ./src/index.js
......
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