Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent restart of NestJS Server when making changes in certain directories

I am using the default nest start --watch command to run the application in watch mode.

The server restarts upon the change of any source file, which is as expected.

However, I need to ignore some directories or files from restarting the server when a change occurs.

Is there a way to achieve this in NestJS?

like image 773
NiK Avatar asked Dec 25 '19 03:12

NiK


1 Answers

I was able to find a workaround. That is updated nodemon.json file to include the directories that I want to ignore from restart. Then to start the app I am just running nodemon command.

{
    "watch": ["src"],
    "ext": "ts",  
    "ignore": ["public"],
    "exec": "ts-node ./src/main"
  }

Hope this helps

like image 195
NiK Avatar answered Oct 24 '22 13:10

NiK