microsoft/TypeScript

TypeScript minification and obfuscation

MrMatthewLayton opened this issue · 1 comments

A friend recently asked me: "Is it worth learning advanced JavaScript or just learn TypeScript instead?" - My response was something along these lines:

The reason I became a better JavaScript developer was because I paid close attention to the way the TypeScript compiler emits JavaScript code, so by learning TypeScript, I automatically became a better JavaScript programmer.

With this in mind, I've noticed that the TypeScript compiler emits clean, well structured and fully qualified (in terms of object / member / methods names) JavaScript code.

I think this is quite a smart move on behalf of Microsoft and the TypeScript team, because it enabled TypeScript to become a learning tool for people who want to write elegant JavaScript as well. This has certainly been my experience.

One thing that worries me about this is that it is too easy for JavaScript programmers to mess around with the emitted code, and begin making a mess of things once again (doing things the non-TypeScript way).

The issue I would like to raise surrounds minification and obfuscation. Firstly, I think the two are almost synonymous in the JavaScript world, because minified code is very difficult to reverse engineer and work with (obfuscated).

Will it be possible in the future to have TypeScript emit minified code?

Hi @series0ne, you might want to read this discussion #8