TypeScript Obfuscation TypeScript Obfuscation typescript typescript

TypeScript Obfuscation


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.


I don't believe there is any reason to do this in TypeScript. You can instead use something like Closure Compiler to do the obfuscation on your JavaScript output. Specifically look into Closure's Advanced Compilation settings.


 Not a direct answer! Js obfuscator

https://github.com/javascript-obfuscator/javascript-obfuscator

Plugins:

Webpack plugin: webpack-obfuscatorWebpack loader: obfuscator-loaderGulp: gulp-javascript-obfuscatorGrunt: grunt-contrib-obfuscatorRollup: rollup-plugin-javascript-obfuscator

NOTE:

Only obfuscate the code that belongs to you.

It is not recommended to obfuscate vendor scripts and polyfills, sincethe obfuscated code is 15-80% slower (depends on options) and thefiles are significantly larger.