npm init
npm i -d babel-cli
npm i -d babel-preset-latest
type nul>.babel
{ "presets":["latest"], "plugins":[] }
{ ... "scripts": { ... "build":"babel src -d release" }, }
"babel js -d release" 可理解爲"把src文件夾下的js文件轉換後存到release文件夾下"es6
let arr=[1,3,5,6,8,9];
npm run build > es6test@1.0.0 build D:\webWork\es6test > babel src -d release src\test.js -> release\test.js
"use strict"; var arr = [1, 3, 5, 6, 8, 9];