npm install -g @dot-event/cli @dot-event/spawn @dot-event/watchman
You'll also need to start watchman (brew install watchman
).
In the examples below, we want to trigger npm run build
when *.js
changes:
dot watchman --glob="*.js" --command=npm --args=run --args=build
If you have a package.json
script with the glob somewhere in it:
{
"scripts": {
"build": "babel *.js --out-dir dist --source-maps"
}
}
The --script
option is a quick way to add a trigger:
dot watchman --script=build