From 90d768668fb589583657aa949683149bc6d33020 Mon Sep 17 00:00:00 2001 From: Arunoda Susiripala Date: Thu, 23 Jun 2016 09:04:03 +0530 Subject: [PATCH] Add support to run inside Meteor. When running this babel-plugin inside Meteor, it gives us weird errors. But, we don't need this to use inside Meteor. Meteor do this for us automatically. So, we simply turn off this when using inside Meteor. --- plugin/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugin/index.js b/plugin/index.js index f6b5d76..8e29090 100644 --- a/plugin/index.js +++ b/plugin/index.js @@ -22,5 +22,15 @@ export default function({ types: t }) { } } + // Here's we detect the use of Meteor and send a dummy plugin. + // That's because, Meteor already do this for us. + // global.meteorBabelHelpers is something we can see when + // running inside Meteor. + if (global.meteorBabelHelpers) { + return { + visitor: {} + }; + } + return new BabelRootImport(); }