Debugging - Nx to automatically setup debugging configuration in vsCode on newly generated application
See original GitHub issueDescription
Debugging is a natural part of any development lifecycle, for both distributed, and/or mono repos, alike. Nx users may benefit tremendously should the app-level generators automatically insert the relevant debugging information into the .vscode/{tasks,launch}.json files.
Motivation
Creating an Angular, or a NestJS, or any other app is very easy within the Nx workspace, which is meant to streamline and speed up the development process. That is all good till there is a need to attach to an application and step through some complex code, and that is all to avoid excessive use of console.log(s).
At that point, one can assume, setting up the debugging information turns into a monumental task. This is true since Nx moves things around to accommodates all variety of apps so they co-exist.
The same, let’s say Angular app in Nx will give users a very hard time, should they try to set up the debugging information. However, if that application was created through NgCli, the setup would be a simple copy & paste of some configuration, right from the vsCode website.
Suggested Implementation
It would be great to automatically populate the .vscode/launch.json as well as .vcode/tasks.json with the necessary information regarding a newly generated application. Nx console already runs in & supports vsCode and the .vscode directory already exists, so we just need to add those two files.
One recommendation would be to add both launch <app> and attach <app>, so users can either have the launcher to start the app, then attach to it, or simply attached to an already laughed application.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:11 (1 by maintainers)
Top Related StackOverflow Question
I got debugging working with my node.js service as well, using this launch.json:
In the meantime, does anyone have a working
launch.jsonfile for Angular where breakpoints are hit and chrome opens properly afternx serveis done?