0 votes
in TypeScript - JavaScript's Superset by
Is it possible to compile .ts automatically with real-time changes in the .ts file?

1 Answer

0 votes
by

Yes, it is possible to compile ".ts" automatically with real-time changes in the .ts file. This can be achieved by using --watch compiler option

tsc --watch file1.ts  

The above command first compiles file1.ts in file1.js and watch for the file changes. If there is any change detected, it will compile the file again. Here, we need to ensure that command prompt must not be closed on running with --watch option.

...