es6-demo

优雅的开发es6

install

新建package.json,内容为:

json{
    "name": "es6-demo",
    "version": "0.0.1",
    "description": "es6-demo",
    "scripts": {
        "check": "fecs check src/*.js",
        "build": "babel --loose all --stage 0 --modules common src/ --out-dir dist/",
        "watch": "npm run build -- --watch",
        "start": "node test.js"
    },
    "devDependencies": {
        "babel": "5.8.21",
        "fecs": "^0.4.13"
    }
}

执行:

npm install

命令

check

使用fecs检查src代码

npm run check

build

es6->es5,从src/编译到dist/

npm run build

watch

监听src/,修改自动编译dist/

npm run watch