1.0.1 • Published 10 years ago
babel-plugin-transform-modules-amd v1.0.1
babel-plugin-transform-modules-amd
es2015 module tranformer for amd.
Difference
because of the difference between es2015 module and amd module,
this plugin don't support named export and default export at the same time.
import * as foo from 'foo'andimport foo from 'foo'are equalexport foo; export default foo;will throw: 'amd module don't supportexport default fooand ,export fooboth, please choose one
Installation
$ npm install babel-plugin-transform-modules-amd --save-devUsage
Via .babelrc (Recommended)
.babelrc
{
"plugins": ["transform-modules-amd"]
}Via CLI
$ babel --plugins transform-modules-amd script.jsVia Node API
require("babel-core").transform("code", {
plugins: ["transform-modules-amd"]
});