From ddd430aaee8b1c0dc31ee43a375278c149ec79d8 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 24 Jan 2023 08:26:14 -0500 Subject: [PATCH] fix: add optional environment variable to disable console.warn --- src/pubsub.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pubsub.js b/src/pubsub.js index 29f73bc..3afd28a 100644 --- a/src/pubsub.js +++ b/src/pubsub.js @@ -12,7 +12,9 @@ if (root.PubSub) { PubSub = root.PubSub; - console.warn("PubSub already loaded, using existing version"); + if (!process.env.PUBSUBJS_DISABLE_EXISTING_VERSION_WARNING) { + console.warn("PubSub already loaded, using existing version"); + } } else { root.PubSub = PubSub; factory(PubSub);