I’m running a node server and I’m using nodemon to restart the server whenever I change the .js file that is running on it. The .js file links to/writes an HTML file that is in the same directory, but when I change something in the HTML file nodemon doesn’t restart the server :( How do I change this?
Mar 14, 2020, 9:59 AM
You need to tell nodemon which files should be watched for changes. By default it looks only for changes in .js and .json files
Create a settings file called nodemon.json:
{
"ext": "js,html"
}
You can also watch for changes in a specific file:
{
"watch" : ["filename.ext"]
}
{
"ext": "js,html"
}
You can also watch for changes in a specific file:
{
"watch" : ["filename.ext"]
}
Mar 14, 2020, 10:16 AM
🙏
Thanks Ocean Byte
It’s working now, not sure where I should save this json file though. Perhaps in my build/app folder?
i.e. in the same folder as the .js that I’m running with nodemon?
Mar 14, 2020, 10:32 AM
Easiest for development I guess, I'd add it to the root folder of your project
Mar 14, 2020, 10:33 AM