From dcc165c3cc91b8363d02791e6d00b8c3bf463f31 Mon Sep 17 00:00:00 2001 From: Daniil Kudryavtsev Date: Wed, 10 Aug 2022 18:01:25 +0200 Subject: [PATCH] Show console.warn only in production --- src/pubsub.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pubsub.js b/src/pubsub.js index 29f73bc..12f2b42 100644 --- a/src/pubsub.js +++ b/src/pubsub.js @@ -12,7 +12,10 @@ if (root.PubSub) { PubSub = root.PubSub; - console.warn("PubSub already loaded, using existing version"); + + if(process && process.env && process.env.NODE_ENV !== 'production'){ + console.warn('PubSub already loaded, using existing version'); + } } else { root.PubSub = PubSub; factory(PubSub);