From 2746db182f1fe5721d1e220673ea1c4b73ae9576 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Mon, 22 May 2017 16:36:53 +0100 Subject: [PATCH] Limit console warnings to 5 files at most (#2327) --- 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])); } }