I have a project based on https://github.com/coryhouse/react-slingshot
I want to integrate flow into the npm start script so that upon running the start script it starts the flow server, by running flow
command, and then runs the flow
command on every *.js file change.
These are the scripts from package.json:
"prestart": "npm run remove-dist",
"start": "parallelshell \"npm run test:watch\" \"npm run open:src\"",
"open:src": "node tools/srcServer.js",
"open:dist": "node tools/distServer.js",
"lint": "eslint src",
"lint:watch": "watch 'npm run lint' src",
"clean-dist": "npm run remove-dist && mkdir dist",
"remove-dist": "node_modules/.bin/rimraf ./dist",
"build:html": "node tools/buildHtml.js",
"prebuild": "npm run clean-dist && npm run build:html",
"build": "npm run test && node tools/build.js && npm run open:dist",
"test": "cross-env NODE_ENV=test mocha --reporter progress --compilers js:babel/register --recursive \"./src/**/*.spec.js\"",
"test:watch": "npm run test -- --watch"
I have flow working independently. I can't figure out how to have the flow command run by the file watcher.
How can I do this?