问题描述
对于诸如 ASP.NET MVC5 之类的 Visual Studio 项目,如何在构建/调试时禁用 TypeScript 文件的编译?
我目前将 tsconfig.json
compileOnSave
和 buildOnSave
设置为 false.是否需要在项目 .csproj
中添加一些内容以确保它不会被编译?
在调试 ASP.NET MVC5 项目时,它会编译所有 .ts
文件.
感谢您提供的任何帮助.
将属性 <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
添加到您的 csproj 文件中的 PropertyGroup 中(我在 Configuration 下添加了它标签).这应该会禁用所有基于 msbuild 的 TS 编译.
启用此设置后,您不需要 tsconfig.json 设置 compileOnSave/buildOnSave.
如果您使用的是旧版本的 Visual Studio(我曾隐含地考虑过 VS 2017 或 2015 的 xproj),则该属性可能是 <TypeScriptEnabled>false</TypeScriptEnabled>
..p>
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.
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>
.
这篇关于禁用 MSBuild TypeScript 编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!