在Visual Studio 2013中禁用typescript编译

juj*_*uju 9 gruntjs visual-studio-2013

我正在运行grunt并设置了一个可以监听文件更改的打字稿构建过程,因此当我保存或构建项目时,我不需要我的打字稿文件的默认VS编译.

我在项目属性中取消选中typescript下的'Compile on save'选项,但ts文件仍在编译中.这对我有用的唯一方法是,如果我将单个TS文件的构建操作设置为"None",但这仍然会导致编译一些Typescript文件.有什么办法可以在VS2013中完成吗?

小智 15

在VS2015中,<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>可以将设置添加到<PropertyGroup>.csproj中的第一个元素

然后应该显示msbuild输出

PreComputeCompileTypeScript:
  TypeScript compile is skipped because the TypeScriptCompileBlocked property is set to true.
Run Code Online (Sandbox Code Playgroud)

来自:http://rostacik.net/2015/08/14/how-to-disable-building-of-typescript-files-in-visual-studio-2015/


小智 -3

将 TypeScript 文件的属性更改Build Action为除TypeScript Compile