From d8c97fba152f9248dc8b839e425c80ef4df52163 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Thu, 28 May 2015 10:25:50 -0400 Subject: [PATCH] check plugin.default and then just plugin to support ES6 modules - closes #1627 --- src/babel/transformation/file/plugin-manager.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/babel/transformation/file/plugin-manager.js b/src/babel/transformation/file/plugin-manager.js index 577cea2171..3a70e0eee6 100644 --- a/src/babel/transformation/file/plugin-manager.js +++ b/src/babel/transformation/file/plugin-manager.js @@ -37,9 +37,10 @@ export default class PluginManager { var loc = util.resolveRelative(`babel-plugin-${name}`) || util.resolveRelative(name); if (loc) { + var plugin = require(loc); return { position: position, - plugin: require(loc) + plugin: plugin.default || plugin }; } else { throw new ReferenceError(messages.get("pluginUnknown", name));