How to watch and compile all TypeScript sources?

后端 未结 9 1271
挽巷
挽巷 2020-12-04 06:53

I\'m trying to convert a pet project to TypeScript and don\'t seem to be able to use the tsc utility to watch and compile my files. The help says I should use t

9条回答
  •  眼角桃花
    2020-12-04 07:31

    The tsc compiler will only watch those files that you pass on the command line. It will not watch files that are included using a /// reference. If your working with the bash, you could use find to recursively find all *.ts files and compile them:

    find . -name "*.ts" | xargs tsc -w
    

提交回复
热议问题