node.js - 是否可以使用 npm pre hooks 启动开发服务器?
问题描述
我目前有这样的东西,它同时运行我的开发服务器和我的 React 应用程序。
"scripts": {
"dev": "run-p yarn proxy:start react-scripts start",
"proxy:start": "nodemon test-proxy.js"
},
我希望做这样的事情:
"scripts": {
"predev": "nodemon test-proxy.js",
"dev": "react-scripts start"
},
但是由于nodemon
永远不会退出,它会一直监视文件,直到您自己退出进程,所以dev
脚本永远不会被触发。
是否可以运行predev
,让它在后台运行(继续运行nodemon
以观察文件更改,最好继续记录任何 I/O 事件)并运行我的 React 启动脚本?
解决方案
推荐阅读
- kubernetes - Kubernetes 服务架构
- java - 配置本地 nexus 服务器以从其他远程 nexus 存储库下载工件
- python - 在 Python 中用带删除“\n”?
- java - fastxml中,反序列化json后,如果枚举是类中的第一个属性,其他字段为null
- c# - JSON 输出中的 DICOM RetrieveURL 标记为空
- operating-system - 操作系统开发。从文件创建可引导的 iso。
- java - Opendaylight - 为什么 Future 在 init 方法中工作而不是在 rpc 中工作?
- c# - 引导模式弹出窗口不适用于更新面板
- javascript - 如何使用 WebSpeech API 将长句从语音转换为文本?
- javascript - 如何测试 JavaScript 内存使用情况