TypeScript/Node.js build&run&debug configuration for Visual Studio Code

After reading allot of pages and pseudo professional opinions on SO, I came up with my simple build end debug configuration for Visual Studio Code.

You basically need three files. tsconfig.json to “compile” your .ts files to appropriate .js files.

tasks.json to actually start the compilation process inside the VSCode GUI

and launch.json to setup the launch end debug process of your nodejs app.

tsconfig.json
{ 
    "compilerOptions": { 
    "target": "ES6", 
    "module":"CommonJS", 
    "outDir": "app", 
    "rootDir": "src", 
    "sourceMap": true, 
    "noImplicitAny": true, 
    "removeComments": true, 
    "preserveConstEnums": true 
    } 
}
tasks.json
{ 
"version": "2.0.0", 
"tasks": [ 
{ 
"type": "typescript", 
"tsconfig": "tsconfig.json", 
"problemMatcher": [ "$tsc" ], 
"group": { "kind": "build", "isDefault": true }, 
"label": "tsc: build - tsconfig.json" } 
]}
launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"preLaunchTask": "tsc: build - tsconfig.json",
"program": "${workspaceFolder}/app/wallet.js"
}
]
}

take notice of the preLaunchTask which launches the compilation process