Tuesday, July 26, 2016

Running VSCode with a Local TypeScript Install

Install TypeScript


First, install TypeScript via

npm install -g typescript
or even

npm install -g typescript@beta
from the root of your app (where your tsconfig is located).

Test your install with...

node ./node_modules/typescript/bin/tsc -p ./
and
node ./node_modules/typescript/bin/tsc -v

Configure VSCode

settings

Under file>>preferences>>settings, select user

This will open settings.json.  Add the following entry:

{
    // Specifies the folder path containing the tsserver and lib*.d.ts files to use.
    "typescript.tsdk":"node_modules/typescript/lib"
}

tasks.json

change

"command": "tsc"
to

"command": ".\\node_modules\\.bin\\tsc.cmd"