jsynowiec/node-typescript-boilerplate

vscode configuration

Tallyb opened this issue · 4 comments

Hi,
Can you add your vscode settings and launch to git? Do you have a debug and tests - debug configurations you can share ?
Great repo!

Thanks!

I want to keep this as much editor/IDE independent as possible so I don't think adding my .vscode folder is a good idea. I can share my tasks and launch configuration as a gist if you like though. Do you need anything in particular?

I'm not using such configs for this boilerplate project, but I'll share some samples from my other projects later.

Sorry for the delay. Here are sample config files.

launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Debug",
      "cwd": "${workspaceRoot}",
      "program": "${workspaceRoot}/src/main.ts",
      "sourceMaps": true,
      "outFiles": ["${workspaceRoot}/build/**/*.js"],
      "preLaunchTask": "build",
      "stopOnEntry": true,
      "console": "internalConsole"
    }
  ]
}

tasks.json

{
  "version": "0.1.0",
  "command": "npm",
  "isShellCommand": true,
  "showOutput": "always",
  "suppressTaskName": true,
  "tasks": [
    {
      "taskName": "build",
      "args": ["run", "build"],
      "isBuildCommand": true
    },
    {
      "taskName": "test",
      "args": ["run", "test"]
    }
  ]
}

Also you can have a look at this SO answer: https://stackoverflow.com/questions/43454168/attaching-grunt-to-vscode-debugger/43481745#43481745 It's not about TypeScript but mechanics are the same.