Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeScript Obfuscation

Tags:

Are there any tools or forks of TypeScript to support public namespace obfuscation? I.e. to turn:

class MyUtil {    print(): void { ... } } 

Into something like:

class xxy {    aab(): void { ... } } 

If not, would be be straight forward to fork the compiler to provide this? Perhaps with some type of class annotation indication what should / shouldn't be obfuscated.

(Obviously public obfuscation has to be used carefully, no good for libraries! But great if used consistently across your project)

like image 897
user826840 Avatar asked Dec 31 '12 13:12

user826840


1 Answers

I had the exact same question, and it was instantly deleted by SO.

https://github.com/angular/ts-minify

This is exactly the tool you (and I) are looking for, it seems to work pretty well, I needed to comment out a few parts where the the author was taking precautions I don't think are applicable.

like image 154
user378380 Avatar answered Sep 20 '22 18:09

user378380