Reputation: 1857
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?
Upvotes: 6
Views: 5302
Reputation: 23
I was able to fix this by editing tsconfig.build.json file and add the folder to the exclude array. "exclude": [..., "your-folder"]
Upvotes: 0
Reputation: 1857
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
Upvotes: 5
Reputation: 31
You should edit these files:
tsconfig.json
tsconfig.build.json
Add the folder/s that you want to ignore in the "exclude" array:
"exclude": [..., "your-folder"]
Upvotes: -3