Only show first error (#2125)

This commit is contained in:
Dan Abramov
2017-05-11 15:54:31 +01:00
committed by GitHub
parent 3521eb7c8b
commit 1ede6a8d12

View File

@@ -177,6 +177,11 @@ function formatWebpackMessages(json) {
// preceding a much more useful Babel syntax error.
result.errors = result.errors.filter(isLikelyASyntaxError);
}
// Only keep the first error. Others are often indicative
// of the same problem, but confuse the reader with noise.
if (result.errors.length > 1) {
result.errors.length = 1;
}
return result;
}