关于nest start命令中--watch与--debug选项的技术咨询
Hey there! Let me clearly explain what the --watch and --debug flags do in the NestJS CLI commands you're setting up:
--watch 选项
This flag enables hot reloading for your development workflow. When added to the nest start command (like in the start:dev script), the Nest CLI will continuously monitor all your application files for changes. As soon as you save an edit to a file—whether it's a controller, service, module, or any other code file—the CLI automatically recompiles your code and restarts the server. This eliminates the hassle of manually stopping and restarting the server every time you make a tweak, making your development process much smoother and faster.
--debug 选项
The --debug flag launches your Nest application in debug mode, which lets debug tools (like those built into VS Code, Chrome DevTools, or other IDEs) attach to your running app. With debug mode active, you can set breakpoints in your code, step through execution line by line, inspect variable values in real time, and dig deep into any issues you encounter.
When combined with --watch (as in the start:debug script), it creates a seamless debugging experience: your server auto-restarts whenever you update code, and it stays in debug mode so you can immediately start debugging the updated code without reconfiguring your debugger.
内容的提问来源于stack exchange,提问作者Heisenberg

