nodemon 不能触发重启

修改相应目录下的js文件,无法触发自动重启的脚本

nodemon配置如下

{
  "restartable": "rs",
  "ignore": [
    ".git",
    "test/*",
    "node_modules/**/node_modules"
  ],
  "verbose": true,
  "execMap": {
    "js": "node ./bin parse-tsd -c tsd-config.json"
  },
  "events": {
    "restart": "osascript -e 'display notification \"App restarted due to:\n'$FILENAME'\" with title \"nodemon\"'"
  },
  "watch": [
    "model",
    "define",
    "service"
  ],
  "env": {
    "DEBUG": "parse-tsd"
  },
  "ext": "js"
}

使用该配置,第一次启动,输出的信息

clipboard.png

阅读 4.6k
1 个回答

自己的问题,项目目录本身在node_modules下,nodemon默认忽略的该目录下的变化,改写nodemon的ignoreRoot配置,问题解决。

clipboard.png

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题