Skip to content

Commit

Permalink
Support es-module default exports in babel plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallswain committed Aug 26, 2021
1 parent be5cf99 commit 6ada067
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/process_babel_plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 6ada067

Please sign in to comment.