From 39bfb9f184e6a0eeb9c85b8d547dd1792a358367 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Mon, 22 May 2017 16:35:42 +0100 Subject: [PATCH] Limit console warnings to 5 files at most --- packages/react-dev-utils/webpackHotDevClient.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/react-dev-utils/webpackHotDevClient.js b/packages/react-dev-utils/webpackHotDevClient.js index cf4deae7c6d..7d6a979e270 100644 --- a/packages/react-dev-utils/webpackHotDevClient.js +++ b/packages/react-dev-utils/webpackHotDevClient.js @@ -228,6 +228,13 @@ function handleWarnings(warnings) { if (typeof console !== 'undefined' && typeof console.warn === 'function') { for (var i = 0; i < formatted.warnings.length; i++) { + if (i === 5) { + console.warn( + 'There were more warnings in other files.\n' + + 'You can find a complete log in the terminal.' + ); + break; + } console.warn(stripAnsi(formatted.warnings[i])); } }