将流量检查整合到反应弹弓中

时间:2016-01-24 00:02:28

标签: npm flowtype react-slingshot

我有一个基于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命令。

我该怎么做?

1 个答案:

答案 0 :(得分:0)

watch 'flow check' src

Usage: watch <command> [...directory] [OPTIONS]

阅读文档here