Friday, May 22, 2020

TypeScript watch compiler parameter

Compiling every changes to your Type Script code, is really  not only time consuming activity but also put huge  pressure your process , especially if you have large source code on your process. Every time it has to compile, propagate the updates to all of its dependencies.
To resolve this issue  on your use the Watch  parameter of tsc compiler.
Syntax for using watch parameter with tsc compiler.

tsc --watch YourTSFile.ts

Now your terminal will be on active mode and start to continuously watching the changes your source code and behind the scene it will compile the code into JS output.
You have to keep your terminal in active mode, it shouldn't be stopped.