2019 Version
New tasks version 2.0.0
Here's how to do it step by step
I compiled this from the documentation:
First i tried ⬆︎ ⌘ B
... This didn't work for me (I was following a YouTube tutorial... a bit outdated it seems).
After looking at the documetation i found that you have to initialize your typescript folder. To do so:
tsc --init
- this will generate a file called tsconfig.json
The documentation said to run code .
after you ran tsc --init
. Mine worked without is as well as with it. Feel free to play with it and see what it changes cause i honestly don't know.
After that, move your mouse up to the toolbar (global Terminal menu.)... underneath the Terminal tab, click on the Configure Default Build Task...
then click on tsc: build
and that will generate your tasks.json
Note that mine generated without the "version": "2.0.0" line... so if yours did the same that means your hardware is too old and you have to upgrade.... i'm kidding! ... Just add "version": "2.0.0",
right above "tasks": [
, and then you should be fine.
✌