Force nodemon to watch file from node_modules

Viewed 1120

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?

1 Answers

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:

Related