preface

With the advent of 7.x, VS Code continues to improve.

NestJS breakpoint debugging is easy to enable.

rendering

The configuration process

Enable auto attach

Ctrl(CMD)+Shift+P –> Debug: Toggle Auto Attach

For normal debug, we always go inspect mode, so see if you are used to it

If it is always enabled, some common projects will frequently report error process exceptions

Debug(.vscode)

If the following two files are not initialized, an error will be reported when executing F5.

It can then be adjusted as guided in.

You can also enter from “Show all commands (CMD + Shift + P)”, as shown in the figure

launch.json

{
    // Use IntelliSense to learn about related attributes.
    // Hover to view descriptions of existing properties.
    / / for more information, please visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0"."configurations": [{"type": "node"."request": "launch"."name": "Start program"."skipFiles": [
                "<node_internals>/**"]."program": "${workspaceFolder}/start"."preLaunchTask": "nest debug"."outFiles": [
                "${workspaceFolder}/dist/**/*.js"]]}}Copy the code

tasks.json

{
	"version": "2.0.0"."tasks": [{"type": "npm"."script": "start:debug"."group": "rebuild"."problemMatcher": []."label": "nest debug"."detail": "nest start --debug --watch"}}]Copy the code

conclusion

If there is something wrong, please leave a message and correct it in time. Thank you for reading!