As per the nestjs start documentation, here are the main functionalities;
--watch
Enable watch mode for live-reload
Alias -w
Any changes made to source files will trigger automatic compilation without manually running npm run start
after each change, making development smoother.
For instance, modifications to typescript files (saved or git-related) within src
will be compiled into javascript files in dist
based on your configuration.
--debug
Activate debug mode with --inspect flag
Alias -d
The use of --debug
involves running the node process utilizing the --inspect
flag for native debugging via an IDE. By connecting to the node debug address and port (usually 127.0.0.1:9229), breakpoints can be utilized for pausing execution.
*Note that current implementations may require the --inspect-brk
flag for breakpoints, as indicated by ongoing issues with the nestjs implementation here.
Some IDEs like VS Code offer an auto-attach feature which negates the need for --debug
and simplifies setup, though it may not be as efficient when working on multiple simultaneous node applications.