79517930

Date: 2025-03-18 15:24:12
Score: 0.5
Natty:
Report link

When running Nest in start:dev mode, make sure to set deleteOutDir to false in the nest-cli.json configuration file:

{
  "compilerOptions": {
    "deleteOutDir": false
  }
}

Also, add the following to your .gitignore file to avoid committing build artifacts:

dist            // or your chosen output directory
*.tsbuildinfo

This is important because, in watch mode (--watch), TypeScript relies on the .tsbuildinfo file. This file helps TypeScript to recompile only the files that have changed. If the output directory were deleted on every build, you’d lose the cached, unmodified files, slowing down the build process.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Starts with a question (0.5): When
  • Low reputation (1):
Posted by: Kacper Obrzut