Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change nodemon config directory?

By default nodemon try to find nodemon.json config file in the project root directory right? How can I prevent this default behavior?

Suppose I put this nodemon.json file in src/config/ so, how should I configure nodemon to look for my own directory?

like image 845
Hasibur Rahman Avatar asked Dec 29 '25 13:12

Hasibur Rahman


1 Answers

After reading the nodemon documentation, I found the solution is very simple just by adding this to the script. We have to add --config flag and then the directory.

"scripts": {
   "start": "node src/index.js",
   "dev": "nodemon --config src/config/nodemon.json src/index.js",
},
like image 90
Hasibur Rahman Avatar answered Jan 01 '26 05:01

Hasibur Rahman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!