avatar

ShīnChvën ✨

Effective Accelerationism

Powered by Druid

VSCode Launch Configuration for Node App

Mon May 08 2023

VSCode's debugging launch configurations are saved in ./vscode/launch.json.

To add a launch configuration for a node app:

  1. click Run and Debug in the left panel.
  2. click create a launch.json file.
  3. add the following configurations for your app.
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch via NPM",
            "type": "node",
            "request": "launch",
            "cwd": "${workspaceRoot}",
            "runtimeExecutable": "npm",
            "runtimeArgs": [
                "run-script", "dev" // your npm script
            ],
        }
    ]
}