- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我想设置nodemon以在服务器重新启动时运行“prestart”脚本,原因是,我正在使用webpack并且我想在每次文件更改时构建bundle.js,我没有使用webpack-dev-server
因为我不知道如何在运行现有 Node 应用程序的情况下设置它,我在node.js
上获得了我的后端,对此的帮助将不胜感激。
我一直以来的工作方式是:每次对代码进行更改时运行npm start
,但这太费力了。
这是 package.json 中的 scripts
对象,以便您了解发生了什么:
"scripts": {
"bundle": "webpack --config webpack.config.js",
"prestart": "npm run bundle",
"start": "node server.js"
}
最佳答案
我完成此操作的方法是使用 exec
属性创建一个 nodemon.json
文件:
{
// ... Other conf (see an example in https://github.com/remy/nodemon/blob/master/doc/sample-nodemon.md)
"watch": [
"app" // Set your directories/files to watch
],
"exec": "npm run prestart && node server/index.js"
}
关于node.js - nodemon 在 package.json 中执行 "prestart"脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35521978/
假设我覆盖了 preStart钩住并向self发送消息: Class SomeActor extends Actor { override def preStart(): Unit = {
我认为标题是不言自明的,但还是: 使用npm的前置脚本有什么好处packege.json例如 prestart只是将命令与 && 连接起来在start脚本? { prestart: "parcel
我想在 Eclipse SDK 的 Scala IDE 构建中使用 java 测试单例 Actor(构建 ID:3.0.2-vfinal-20131028-1923-Typesafe),Akka 是
我想设置nodemon以在服务器重新启动时运行“prestart”脚本,原因是,我正在使用webpack并且我想在每次文件更改时构建bundle.js,我没有使用webpack-dev-server因
我是一名优秀的程序员,十分优秀!