From 44c2791849f37e2082b080faf2677e8e56bcdba6 Mon Sep 17 00:00:00 2001 From: Logan Smyth Date: Mon, 13 Nov 2017 11:33:08 -0800 Subject: [PATCH] Expose a function for plugins to check if async plugins are supported by the current compilation. --- packages/babel-core/src/config/loading/files/configuration.js | 1 + packages/babel-core/src/config/option-manager.js | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/babel-core/src/config/loading/files/configuration.js b/packages/babel-core/src/config/loading/files/configuration.js index 663fdcb4a7..1c44439092 100644 --- a/packages/babel-core/src/config/loading/files/configuration.js +++ b/packages/babel-core/src/config/loading/files/configuration.js @@ -142,6 +142,7 @@ const readConfigJS = makeStrongCache((filepath, cache) => { cache, // Expose ".env()" so people can easily get the same env that we expose using the "env" key. env: () => cache.using(() => getEnv()), + async: () => false, }); } else { cache.forever(); diff --git a/packages/babel-core/src/config/option-manager.js b/packages/babel-core/src/config/option-manager.js index 394f89d9f6..b9ea81c796 100644 --- a/packages/babel-core/src/config/option-manager.js +++ b/packages/babel-core/src/config/option-manager.js @@ -189,6 +189,7 @@ const loadDescriptor = makeWeakCache( const api = Object.assign(Object.create(context), { cache, env: () => cache.using(() => getEnv()), + async: () => false, }); try {