Compiling a new compiler

Topics: General
Nov 15, 2012 at 9:01 PM

I'm wanting to dig into the code and my hand at some debugging of the compiler but I can't seem to work out how you generate a new version of tsc from the source on codeplex.

How do you use tsc to output a new version of tsc?

Nov 16, 2012 at 7:52 PM

In Windows, with VS installed, you should be able to open a new VS2012 x86 (or x64) Native Tools Command Prompt, cd to the directory with the source and run:

nmake local

which will compile a new version of the compiler and put it into built\local

Nov 22, 2012 at 6:31 AM

Actually, it's much simpler, just run in 'compiler' directory:

tsc tsc.ts -out tsc.js


tsc.ts contains the entry point of the compiler and references all other parts, naturally. The '-out' option makes sure you get a single output JavaScript file.


The only downside is you don't get the license header in the output. Which is a shame, but doesn't make much difference in terms of debugging.

Nov 22, 2012 at 7:55 AM


tsc --help

and especially

tsc -c
to preserve comments?