From 6ada067b4913b347f78e40446725be338d54b55a Mon Sep 17 00:00:00 2001 From: Marshall Thompson Date: Thu, 26 Aug 2021 10:28:16 -0600 Subject: [PATCH] Support es-module default exports in babel plugins --- lib/process_babel_plugins.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/process_babel_plugins.js b/lib/process_babel_plugins.js index a1c61120..0885b50d 100644 --- a/lib/process_babel_plugins.js +++ b/lib/process_babel_plugins.js @@ -70,6 +70,11 @@ function processPlugins(baseURL, plugins) { // load the plugin! var pluginFn = require(npmPluginNameOrPath); + // check for ESM default export + if (pluginFn.default) { + pluginFn = pluginFn.default; + } + if (_.isString(plugin)) { normalized.push(pluginFn); }