How to stop Visual Studio/msbuild from recompiling TypeScript when there are no changes

126 views Asked by At

I have a c# MVC project with a fair amount of TypeScript source, which takes around 5 seconds to compile. Whenever we build the project, the TypeScript recompiles, even if nothing has changed (e.g. a referenced assembly changes, so the c# needs to recompile, but this shouldn't force the TypeScript to recompile).

Is there a way to make it so TypeScript compilation is skipped if nothing changes?

1

There are 1 answers

1
Zhanglong Wu - MSFT On

visual studio does not support TypeScript compiler option named –watch, which run the compiler in watch mode. Watch input files and trigger recompilation on changes. For more information, please refer to:

enter image description here

enter image description here

https://www.typescriptlang.org/docs/handbook/compiler-options-in-msbuild.html

https://www.typescriptlang.org/docs/handbook/compiler-options.html