Skip to content

Instantly share code, notes, and snippets.

@navono
Forked from cecilemuller/launch.json
Created February 23, 2022 06:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save navono/2426a49228e85a2fa119a8a1e9be2ddf to your computer and use it in GitHub Desktop.
Save navono/2426a49228e85a2fa119a8a1e9be2ddf to your computer and use it in GitHub Desktop.
Run ts-node in VSCode Debugger
{
"version": "0.2.0",
"configurations": [
{
"name": "Example",
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],
"args": ["src/script.ts", "--example", "hello"],
"cwd": "${workspaceRoot}",
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": ["<node_internals>/**", "node_modules/**"]
}
]
}
@navono
Copy link
Author

navono commented Feb 23, 2022

WebStorm:
--require ts-node/register

@navono
Copy link
Author

navono commented Feb 24, 2022

  "name": "debug",
  "type": "node",
  "request": "launch",
  "runtimeExecutable": "node",
  "runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
  "cwd": "${workspaceRoot}",
  "program": "${workspaceFolder}\\node_modules\\moleculer\\bin\\moleculer-runner.js",
  "args":["--hot", "--repl", "-c", "./moleculer.config.ts", "./services/**/*.service.ts"],
  "skipFiles": ["<node_internals>/**", "node_modules/**"]

@navono
Copy link
Author

navono commented Jul 4, 2022

{
// 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": "debug",
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": [
"--nolazy",
"-r",
"ts-node/register/transpile-only"
],
"args": [
"src/main.ts",
],
"cwd": "${workspaceRoot}",
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": [
"<node_internals>/",
"node_modules/
"
]
},
{
"type": "node",
"request": "launch",
"name": "Jest: current file",
//"env": { "NODE_ENV": "test" },
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"${fileBasenameNoExtension}",
"--config",
"jest.config.js"
],
"console": "integratedTerminal",
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
},
{
"name": "Jest Tests",
"type": "node",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/node_modules/.bin/jest",
"--runInBand"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
}
]
}

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