skayred skayred - 21 days ago 5
TypeScript Question

TypeScript compiling as a single JS file

I have a test project on TypeScript, code can found here.

When I'm creating new project with VS2012, an

app.ts
file is created. When I'm changing it's content as shown by the link and adding new module called
GameModule
, I'm getting compile error. When I', deleting
app.ts
and creating
Main.ts
instead, everything compiling fine, but there is a problem - only
Main.ts
is compiled to
Main.js
, and
GameModule.ts
stays uncompiled.

How can I make compiler to merge all the code in one JS?

Answer

You have to use command line arguments of compiler

--out FILE Concatenate and emit output to single file

example

 tsc --out modules.js main.ts app.ts