Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NestJS - exclude folder under watch mode

Tags:

nestjs

I created a public folder within root directory to store user uploaded files. But under npm run start:dev mode, every time I upload a file, Nest has detected file change and restarts server. How can I do to avoid this? Thanks.

Dir structure:

-project
 -dist
 -src
 -public
 -(other files)
like image 835
user11762401 Avatar asked Mar 14 '20 06:03

user11762401


Video Answer


2 Answers

Insert the following in tsconfig.json:

...,
  "include": ["src"],
  "exclude": [
    "node_modules",
    "dist",
    "public"
  ]
like image 179
s.d.fard Avatar answered Oct 03 '22 07:10

s.d.fard


Under tsconfig.json include the below property immediately after exclude property

  "include": [ "src"]
like image 24
Priest Sabo Avatar answered Oct 03 '22 07:10

Priest Sabo