目录

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' and import foo from 'foo' are equal
  • export foo; export default foo; will throw: ‘amd module don’t support export default foo and , export foo both, please choose one

Installation

$ npm install babel-plugin-transform-modules-amd --save-dev

Usage

.babelrc

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

Via CLI

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

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-modules-amd"]
});
关于
46.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号