Hello Friends,
Today our topic is on How to Compile Your TypeScript File Automatically.
There are two ways exists by which we can compile our typescript file automatically,
i/ By Creating tasks.json file
ii/ tsc *.ts --watch
i/Creating tasks.json file:-
-------------------------------
First Open the command palette using CTRL+SHIFT+P and type tasks.
Select Configure Default Build Task and select tsc:watch.
This will create a new file .vscode/tasks.json file.
After this, Build typescript file by using CTRL+SHIFT+B.
Then if we change anything in our typescript file then automatically it will compile.
ii/ tsc *.ts -watch:
-----------------------
When you run this command, tsc *.ts --watch then automatically typescript compiler will put a watch in that typescript file.
And when you change the typescript file then automatically it will compile.
Wish You Success,
#VCreationsTech.