Skip to content

Instantly share code, notes, and snippets.

@cecilemuller
Created June 16, 2020 23:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cecilemuller/a8cf12d52ca4f2fc4ba8a9d634b060f9 to your computer and use it in GitHub Desktop.
Save cecilemuller/a8cf12d52ca4f2fc4ba8a9d634b060f9 to your computer and use it in GitHub Desktop.
Run nodemon in the VSCode debugger
{
"version": "0.2.0",
"configurations": [
{
"name": "Nodemon for Typescript",
"type": "node",
"request": "launch",
"runtimeExecutable": "nodemon",
"cwd": "${workspaceFolder}",
"runtimeArgs": ["--exec", "node --inspect-brk=9229 --require ts-node/register src/server.ts"],
"port": 9229,
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": ["<node_internals>/**", "node_modules/**"],
"restart": true
},
{
"name": "Nodemon for Javascript",
"type": "node",
"request": "launch",
"runtimeExecutable": "nodemon",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/src/server.js",
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": ["<node_internals>/**", "node_modules/**"],
"restart": true
}
]
}
@cecilemuller
Copy link
Author

cecilemuller commented Jun 16, 2020

Note that it only works for servers (such as Express), it doesn't work for "run once and stop, then run again if the file changed" scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment