2

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 Answers 3

5

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)
1
  • would be good to know what they do rather than just listing their names
    – morpheus
    Commented Nov 19, 2015 at 3:51
4

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
0

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.

2
  • This only works with VS 2012. If you have VS 2010 you need to manually edit the CSPROJ file. Commented Apr 7, 2013 at 16:24
  • Oops, sorry about that. I forgot that the Typescript plugin even works with VS2010.
    – GJK
    Commented Apr 7, 2013 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.