Show Typescript command line options when building in Visual Studio

时间:2015-07-31 19:37:42

标签: .net visual-studio typescript

I'm trying to familiarize myself with the VS 2015 Typescript project, and the differences between all the build options. When I read questions/answers on SO, they are usually referring to command line options, and I don't always know how they translate to the Typescript Build options in the VS 2015 UI.

Is there a window somewhere (or extension?) that shows the actual command line that visual studio runs when you select the various project Typescript Build options?

1 个答案:

答案 0 :(得分:1)

Visual Studio通过Microsoft.TypeScript.targets编译TypeScript,它将选项文件的路径传递给tsc.exe,例如:

"C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.5\tsc.exe"  @"C:\Users\Username\AppData\Local\Temp\tmp12bc368455ec43d08c6a17ac865eb778.rsp"

.rsp档案的内容:

--sourcemap --target ES6 --noEmitOnError --locale en-US "C:\Users\Username\Documents\Visual Studio 2015\Projects\TypeScriptHTMLApp1\TypeScriptHTMLApp1\app.ts" ......

不幸的是,它是一个临时文件,因此很难从中获取选项。

您可以在文本编辑器中打开.csproj文件,找到MSBuild选项并获取命令行等效项:

https://github.com/Microsoft/TypeScript/wiki/Setting-Compiler-Options-in-MSBuild-projects

更新:您可以在工具中启用详细构建输出 - >选项: enter image description here