How to provide command line options to TS compiler from VS?

Topics: General
Oct 2, 2012 at 7:35 PM

How can I provide additional command line options to the TS compiler (like --module, etc.) when building from Visual Studio 2012 for the Web?


Thank you!

Oct 2, 2012 at 7:59 PM
Edited Oct 2, 2012 at 8:00 PM


We need this. I've already spent a bunch of time unloading my project, editing the command-line, reloading the project, finding that I broke something, and repeating...

It seems like we'll need to do this on almost every new project, including the following common scenarios:

  • target ES5 for properties (--target)
  • target AMD modules for browsers (--module)
  • output single file for browsers (--out)

How about right-click -> Properties -> Build for this? Also, see this discussion for more build stuff we'd love to see:

Oct 4, 2012 at 12:39 AM

We are very aware of the need for greater compiler option support within Visual Studio.  As billyzkid outlined, you can modify the command-line in the project file currently.  It's not ideal, and we plan to improve this over coming releases, but for our preview release, the story is quite limited.  (Another option is use the @file switch for the TSC command, and reference this in the project build command - that way you can modify this file rather than your project for every setting change).

Oct 4, 2012 at 8:16 PM

Why is it a compilation step?  Why not use a custom tool to generate the files on the fly (and show the .js files nested under the .ts file)?  The problem with compilation is that it may force you out of a debug session.