From 6e1622cb899b80c7e9b1329154a983c35a46dc3b Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Thu, 30 Aug 2018 23:31:18 +0200 Subject: [PATCH] Fix DEV always being false in webpack --- src/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 9b1d69d..d38d02f 100644 --- a/src/index.js +++ b/src/index.js @@ -30,7 +30,11 @@ const CAMEL_PROPS = /^(?:accent|alignment|arabic|baseline|cap|clip|color|fill|fl const BYPASS_HOOK = {}; /*global process*/ -const DEV = typeof process !== 'undefined' && process.env && process.env.NODE_ENV!=='production'; +let DEV = false; +try { + DEV = process.env.NODE_ENV!=='production'; +} +catch (e) {} // a component that renders nothing. Used to replace components for unmountComponentAtNode. function EmptyComponent() { return null; }