diff --git a/packages/babel-core/src/transformation/file/options/option-manager.js b/packages/babel-core/src/transformation/file/options/option-manager.js index ad4fbf4ed9..808f8947f4 100644 --- a/packages/babel-core/src/transformation/file/options/option-manager.js +++ b/packages/babel-core/src/transformation/file/options/option-manager.js @@ -281,6 +281,9 @@ export default class OptionManager { val = require(presetLoc); } + // If the imported preset is a transpiled ES2015 module, grab the default export. + if (typeof val === "object" && val.__esModule) val = val.default; + // For compatibility with babel-core < 6.13.x, allow presets to export an object with a // a 'buildPreset' function that will return the preset itself, while still exporting a // simple object (rather than a function), for supporting old Babel versions.