What are the TypeScript project build configuratio

2020-02-11 09:20发布

When I create a new "HTMLWeb App" project, I get a .csproj with a few default options in the project XML for Typescript. Where can I find a list of all possible TypeScript build options?

Searching for the names of the 3 options currently in my project, such as "TypeScriptIncludeComments", returned no results on Google.

3条回答
做自己的国王
2楼-- · 2020-02-11 10:01

I found the list of options in the .targets file that shipped with the TypeScript installation. Here is the full list of options with the command line argument that gets actually sent to "tsc.exe" (the TypeScript compiler)

  • TypeScriptIncludeComments ..... --comments
  • TypeScriptGeneratesDeclarations ..... --declaration
  • TypeScriptModuleKind ..... --module $(TypeScriptModuleKind)
  • TypeScriptIncludeDefaultLib ..... --nolib
  • TypeScriptOutFile ..... --out $(TypeScriptOutFile)
  • TypeScriptSourceMap ..... --sourcemap
  • TypeScriptTarget ..... --target $(TypeScriptTarget)
  • TypeScriptAdditionalFlags ..... $(TypeScriptAdditionalFlags)
查看更多
放我归山
3楼-- · 2020-02-11 10:07

Update on Guptas's answer for Visual Studio 2015 RC. The Microsoft.TypeScript.targets file is now in c:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript.

  • TypeScriptRemoveComments ..... --removeComments
  • TypeScriptNoImplicitAny ..... --noImplicitAny
  • TypeScriptGeneratesDeclarations ..... --declaration
  • TypeScriptModuleKind ..... --module "$(TypeScriptModuleKind)"
  • TypeScriptOutFile ..... --out "$(TypeScriptOutFile)"
  • TypeScriptOutDir ..... --outDir "$(TypeScriptOutDir)"
  • TypeScriptSourceMap ..... --sourcemap
  • TypeScriptTarget ..... --target $(TypeScriptTarget)
  • TypeScriptNoResolve ..... --noResolve
  • TypeScriptAdditionalFlags ..... $(TypeScriptAdditionalFlags)
  • TypeScriptMapRoot ..... --mapRoot "$(TypeScriptMapRoot)"
  • TypeScriptSourceRoot ..... --sourceRoot "$(TypeScriptSourceRoot)"
  • TypeScriptCodePage ..... --codepage $(TypeScriptCodePage)
  • TypeScriptCharset ..... --charset $(TypeScriptCharset)
  • TypeScriptEmitBOM ..... --emitBOM
  • TypeScriptNoLib ..... --noLib
  • TypeScriptPreserveConstEnums ..... --preserveConstEnums
  • TypeScriptSuppressImplicitAnyIndexErrors ..... --suppressImplicitAnyIndexErrors
查看更多
Anthone
4楼-- · 2020-02-11 10:16

The easiest way to change any Typescript build options is with Web Extensions. I'd highly recommend it if you do any kind of web work with Visual Studio.

查看更多
登录 后发表回答