diff --git a/.babelrc b/.babelrc index 74cf459e3a..7717ac3939 100644 --- a/.babelrc +++ b/.babelrc @@ -10,6 +10,14 @@ "transform-flow-strip-types" ], "env": { + "watch": { + "presets": [ + ["es2015", { + "loose": true + }], + "stage-0" + ] + }, "test": { "plugins": ["istanbul"] } diff --git a/package.json b/package.json index e9046ffe2c..e8482c806f 100644 --- a/package.json +++ b/package.json @@ -40,17 +40,18 @@ "babylon": "./bin/babylon.js" }, "scripts": { - "build": "rollup -c", + "build": "npm run clean && rollup -c", "coverage": "nyc report --reporter=json && codecov -f coverage/coverage-final.json", "lint": "eslint src bin", "clean": "rimraf lib", "flow": "flow", - "prepublish": "npm run clean && cross-env BABEL_ENV=production npm run build", + "prepublish": "cross-env BABEL_ENV=production npm run build", "preversion": "npm run test && npm run changelog", "test": "npm run lint && npm run flow && npm run build -- -m && npm run test-only", "test-only": "ava test", "test-ci": "nyc npm run test-only", - "changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'" + "changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'", + "watch": "npm run clean && cross-env BABEL_ENV=watch babel src --out-dir lib --watch" }, "nyc": { "include": [