禁用MSBuild TypeScript编译 [英] Disable MSBuild TypeScript Compile

查看:84
本文介绍了禁用MSBuild TypeScript编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于Visual Studio项目(例如ASP.NET MVC5),如何在生成/调试时禁用TypeScript文件的编译?

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

我目前将tsconfig.jsoncompileOnSavebuildOnSave设置为false.是否需要在项目.csproj中添加一些内容以确保其未编译?

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?

调试ASP.NET MVC5项目时,它将编译所有.ts文件.

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

感谢您提供的任何帮助.

Thank you for any help you can provide.

推荐答案

将属性<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>添加到csproj文件中的PropertyGroup中(我将其添加到配置"标签下).这应该禁用所有基于msbuild的TS编译.

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.

启用此设置后,您不需要tsconfig.json设置compileOnSave/buildOnSave.

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

如果您使用的是旧版Visual Studio(我曾隐式考虑过VS 2017或xproj with 2015),则该属性可能为<TypeScriptEnabled>false</TypeScriptEnabled>.

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>.

这篇关于禁用MSBuild TypeScript编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆