Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

For a Visual Studio projects such as a ASP.NET MVC5, how do you disable compiling of TypeScript files on build/debug?

I currently have tsconfig.json compileOnSave and buildOnSave set to false. Does something need to be added to the projects .csproj to ensure it isn't compiled?

When debugging the ASP.NET MVC5 project, it compiles all .ts files.

Thank you for any help you can provide.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
695 views
Welcome To Ask or Share your Answers For Others

1 Answer

Add the property <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked> to a PropertyGroup in your csproj file (I added it under the Configuration label). This should disable all msbuild based TS compilation.

With this setting enabled you shouldn't need the tsconfig.json settings compileOnSave/buildOnSave.

If you are on an older version of Visual Studio (I had implicitly thought about VS 2017 or xproj with 2015), the property may be <TypeScriptEnabled>false</TypeScriptEnabled>.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...