From de5af31a0a70d43de8a2256da0f84149aa396af3 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Wed, 23 Nov 2016 16:02:34 -0500 Subject: [PATCH] Add watch script for dev --- .babelrc | 8 ++++++++ package.json | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) 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": [