Skip to content

Instantly share code, notes, and snippets.

@eriknovak
Last active February 16, 2021 08:51
Show Gist options
  • Save eriknovak/f4ffedc715a23a3ba75da9fc453050a0 to your computer and use it in GitHub Desktop.
Save eriknovak/f4ffedc715a23a3ba75da9fc453050a0 to your computer and use it in GitHub Desktop.
VSCode NodeJS debug configuration
// IMPORTANT: The configuration file must be a JSON
// This configuration is in .js because of the "comments" errors shown in the gist.
// When copying into the `launch.json` file in vscode just copy the json structure
// without the `module.exports = ` part.
module.exports = {
// 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": [
{
"type": "pwa-node",
"request": "launch",
// set the name of the debug: must be unique from other configs in the file
"name": "Configuration Name",
"skipFiles": [
"<node_internals>/**"
],
// if using nvm: set the node version in which you want to debug
// otherwise: remove "runtimeVersion"
"runtimeVersion": "14",
// this is used to define the environment in which the script is run
// if using environment variables: define them here
// otherwise: remove "env"
"env": { "NODE_ENV": "production" },
// set the path to the location where the script should be run
// default: "${workspaceFolder}"
"cwd": "${workspaceFolder}/dist/",
// the path to the program/script to debug
"program": "${workspaceFolder}/dist/index.js",
// if script requires arguments: add them here
// otherwise: remove "args"
"args": ["-a", "this", "--model", "bert"]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment