node端测试package模板-babel

json{
  "name": "",
  "version": "1.0.0",
  "description": "",
  "main": "lib/index.js",
  "scripts": {
    "check": "fecs check src/ test/ --reporter=baidu --rule",
    "compile": "babel src/ -d lib/",
    "watch": "npm run compile -- --watch",
    "prepublish": "npm run compile",
    "test:watch": "npm run test -- --watch",
    "test:cov": "istanbul cover node_modules/mocha/bin/_mocha -- --compilers js:babel-register -t 5000 --recursive  -R spec test/",
    "test": "mocha --compilers js:babel-register --reporter spec --timeout 5000 --recursive test/",
    "preversion": "npm run check",
    "postversion": "git push origin master && git push origin --tags"
  },
  "repository": {
    "type": "git",
    "url": ""
  },
  "contributors": [
  ],
  "author": "xuexb <fe.xiaowu@gmail.com>",
  "keywords": [
    "urlpath"
  ],
  "license": "MIT",
  "bugs": {
    "url": ""
  },
  "homepage": "",
  "devDependencies": {
    "babel-cli": "6.x.x",
    "babel-plugin-add-module-exports": "^0.2.1",
    "babel-plugin-transform-runtime": "6.x.x",
    "babel-preset-es2015": "6.x.x",
    "babel-preset-stage-0": "6.x.x",
    "babel-preset-stage-3": "6.x.x",
    "chai": "^3.5.0",
    "fecs": "^1.2.2",
    "istanbul": ">=1.0.0-alpha.2",
    "mocha": "^3.2.0",
    "sinon": "^2.1.0",
    "sinon-chai": "^2.9.0"
  },
  "dependencies": {
    "babel-runtime": "6.x.x"
  }
}

.babelrc 配置

json{
    "presets": [
      "es2015",
      "stage-0",
      "stage-3"
    ],
    "plugins": [
      "transform-runtime",
      "add-module-exports"
    ]
}