From 9ce144ed90c37f116b8457821d36dba2ceb0490a Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Wed, 11 Oct 2017 14:20:23 -0400 Subject: [PATCH] Add warning when using `react-error-overlay` in production (#3264) * Add a warning when running minified * Add more robust check * Update index.js --- packages/react-error-overlay/src/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/react-error-overlay/src/index.js b/packages/react-error-overlay/src/index.js index a800595cffb..8bc61ca250e 100644 --- a/packages/react-error-overlay/src/index.js +++ b/packages/react-error-overlay/src/index.js @@ -167,3 +167,10 @@ window.__REACT_ERROR_OVERLAY_GLOBAL_HOOK__.iframeReady = function iframeReady() isLoadingIframe = false; updateIframeContent(); }; + +if (process.env.NODE_ENV === 'production') { + console.warn( + 'react-error-overlay is not meant for use in production. You should ' + + 'ensure it is not included in your build to reduce bundle size.' + ); +}