babel/packages/babel-plugin-transform-es2015-modules-amd
Henry Zhu 253918c30f Fix buildExportAll to account for commonjs/amd/systemjs (#3591)
* Fix buildExportAll to account for commonjs/amd

If the re-exported module was generated with Babel and it is a commonjs or amd module and so is the current module, this will result in an attempt to redefine the __esModule property, which throws a runtime error.

* Add test: don't overwrite __esModule on re-export

(Failing.)

* fixup tests

* Add fix for systemjs
2016-07-23 13:21:07 -04:00
..
2016-02-14 23:25:14 +00:00
2015-10-30 23:45:42 +00:00
2016-05-02 19:43:49 -04:00
2015-10-29 17:51:24 +00:00

babel-plugin-transform-es2015-modules-amd

Installation

$ npm install babel-plugin-transform-es2015-modules-amd

Usage

.babelrc

{
  "plugins": ["transform-es2015-modules-amd"]
}

Via CLI

$ babel --plugins transform-es2015-modules-amd script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-es2015-modules-amd"]
});