Typescript command line compilation without NodeJS

Grofit picture Grofit · Mar 20, 2013 · Viewed 8.1k times · Source

I was looking over Typescript and was a bit confused about how you could build your js files from the ts files via the command line.

It implies in the documentation that you can do it easily through nodeJS, which would be great if I wanted a dependency on nodeJS... So is there any way to compile it via the command line without having nodeJS or visual studio?

This may seem crazy to some, but I would just put a build script step to output the javascript at the end if possible then package it into my release, as I tend to do most of my javascript development with RubyMine and don't want a dependency on nodeJS or Visual Studio for my build server.

Answer

Ryan Cavanaugh picture Ryan Cavanaugh · Mar 20, 2013

If you install the TypeScript Tools without Visual Studio installed on the machine, tsc.exe and its dependencies will still get installed.

You can also just xcopy deploy tsc.exe (I don't have a definitive list of its dependencies, but it's pretty straightforward to figure out, or just copy everything that gets installed to the SDK folder) to a build server. The only thing unexpected you would need is msvcr110.dll, which you may or may not need to copy to tsc.exe's path.