Stop Nodemon from restarting when a specific file is updated?

Answered
coderguy asked this question 5 months ago
coderguy on Jun 24

In my Node.js application, I use Nodemon to automatically restart my application when I make a code change.

But I have a specific JSON file that gets updated that I don't want the application to restart for.

How can I configure Nodemon to ignore that file?

2 suggested answers
looper003 on Jun 24

Nodemon has an --ignore flag you can add to the nodemon command.

Ignore a file:

nodemon ignore lib/data.json

You can also do a pattern to ignore changes in all json files:

nodemon --ignore '*.json'
0 replies
yaboy01 on Jun 24

Check out their documentation: https://github.com/remy/nodemon#ignoring-files.

You can simply add a --ignore flag to it:

nodemon --ignore lib/app.js
0 replies
Answered