Allow presets to be ES6 exports.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user