Force nodemon to watch file from node_modules
Asked Answered
M

1

5

Hello is there any chance of making nodemon watch for changes of a specific module in node_modules

I have started the nodemon like this

nodemon index.js --watch 'node_modules/specific_module/**

I have also tried with nodemon.json file

"watch": [
  "node_modules/specific_module/**"
]

But to no avail. Is there any way of achieving this behavior or anything in node_modules is forever ignored no matter what i do?

Meyerbeer answered 15/9, 2018 at 18:36 Comment(2)
Check the docs on github: github.com/remy/nodemon/blob/master/…Garrett
Yeah I have just found that not sure how I failed to notice that. Well make it an answer :)Meyerbeer
H
8

Nodemon: watch the modules folder

As @variable mentions in the comments, here is a nodemon.json to include node_modules (and obviously exclude .git:

{
"ignoreRoot": [".git"]
}

From the docs:

Say you did want to watch the node_modules directory. You have to override the ignoreRoot. If you wanted this on a per project basis, add the config to you local nodemon.json. If you want it for all projects, add it to $HOME/nodemon.json:

Huygens answered 6/4, 2021 at 19:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.