Fix displaying third party webpack plugins errors (#5137)

This commit is contained in:
Viktor Havrylin
2018-09-27 19:02:17 +03:00
committed by Joe Haddad
parent ce5a2e4e14
commit be8f9da4cf

View File

@@ -32,6 +32,11 @@ function formatMessage(message, isError) {
return message.indexOf('Thread Loader (Worker') === -1;
});
// Add empty line for errors from third-party webpack plugins
if (lines.length < 2) {
lines[1] = '';
}
// Strip `ModuleWarning` head off message before parsing (because of ESLint)
// https://github.com/webpack/webpack/blob/c77030573de96b8293c69dd396492f8e2d46561e/lib/ModuleWarning.js
var moduleWarningPrefix = 'Module Warning: ';