2

Can someone provide an example of VS Code configuration that would allow me to:

  • Start Node.js debugger
  • Edit any TS file, see the project recompiled and debugger restarted?

Is this supported out of the box? Can nodemon be used somehow? Thanks.

1

1 Answer 1

1

Yes, you can use nodemon. In your launch.json, if you trigger intellisense (ctrl+space), you will see snippets with suggested launch configs. There's one for nodemon which looks like this:

{
    "type": "node",
    "request": "launch",
    "name": "nodemon",
    "runtimeExecutable": "nodemon",
    "runtimeArgs": [
        "--debug=5858"
    ],
    "program": "${workspaceRoot}/app.js",
    "restart": true,
    "port": 5858,
    "console": "integratedTerminal",
    "internalConsoleOptions": "neverOpen"
}

The docs have an explanation of how it works: https://code.visualstudio.com/docs/editor/node-debugging#_restaring-debug-sessions-automatically-when-source-is-edited

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.