Build all ts files in one js file

Topics: General
Oct 12, 2012 at 1:03 PM
Edited Oct 12, 2012 at 1:04 PM


TypeScript build one js file per js file.

In a C# project, all cs files are build in a single dll.

Why TypeScript does not build all ts files of a project in a single js file ?
And why the js file is not minify ?

With TypeScript, I would like to build js files like I build dlls.
I don't mind if the js is not human frendly.

Oct 12, 2012 at 1:09 PM

You can build all ts files into a single js file if you use the --out flag.

tsc --out all.js foo.ts bar.ts quux.ts

You can then minify that js file using Uglify or Closure.

Oct 12, 2012 at 1:16 PM

Thanks for your quick anwser.