我有一个基于https://github.com/coryhouse/react-slingshot
的项目我想将flow集成到npm启动脚本中,以便在运行启动脚本时通过运行flow
命令启动流服务器,然后运行flow
命令每个* .js文件都会更改。
这些是来自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"
我有独立的流程。我无法弄清楚如何让文件观察程序运行flow命令。
我该怎么做?