Skip to content

Commit

Permalink
Support plugins that conform to ES6 modules
Browse files Browse the repository at this point in the history
Summary:
ES6 modules export an object with a property called `default`. See Babel itself for how this is handled: babel/babel@b5b7e34
Closes #4513

Reviewed By: svcscm

Differential Revision: D2715512

Pulled By: mkonicek

fb-gh-sync-id: 40e5ea35adcdb66806a4895578d637cd72538619
  • Loading branch information
ide authored and facebook-github-bot-5 committed Dec 4, 2015
1 parent c1849e7 commit dff8f53
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packager/transformer.js
Expand Up @@ -48,6 +48,7 @@ function transform(src, filename, options) {
// Only resolve the plugin if it's a string reference.
if (typeof plugin[0] === 'string') {
plugin[0] = require(`babel-plugin-${plugin[0]}`);
plugin[0] = plugin[0].__esModule ? plugin[0].default : plugin[0];
}
return plugin;
});
Expand Down

0 comments on commit dff8f53

Please sign in to comment.