Is it possible to compile TypeScript into minified code?

TypescriptMinify

Typescript Problem Overview


Is there an option to compile TypeScript code's output as minified? Or are we left to deal with that in a separate process? And does obfuscation affect the answer?

Typescript Solutions


Solution 1 - Typescript

The TypeScript compiler does not support the generation of minifies or obfuscated code. you will need to use another tool against the JavaScript output of the compiler.

There's an open feature request: microsoft/TypeScript#8

Solution 2 - Typescript

I am the author of typescript-closure-compiler.
Basically it is a tool that emits files that are compatible with google closure compiler, which is probably the best minifier/optimizer/obfuscator out there.
I've also created a playground that can show you the generated output.
You can take a look at an example project which uses this tool.
The minification process is done using gulp.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLordZardeckView Question on Stackoverflow
Solution 1 - Typescriptmohamed hegazyView Answer on Stackoverflow
Solution 2 - TypescriptSagiView Answer on Stackoverflow