首页 > 代码库 > 手动es6编译es5(命令行)

手动es6编译es5(命令行)

package.json:
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-core": "^6.18.2",
"babel-plugin-transform-es2015-arrow-functions": "^6.8.0",
"babel-preset-es2015": "^6.18.0"
}

需要依赖以上包文件


编写script.js:
‘use strict‘;

let breakfast = (dessert, drink) => dessert + drink;

执行命令 babel script.js -o script-compiled.js
即可


手动es6编译es5(命令行)