打字稿混淆 [英] TypeScript Obfuscation

查看:67
本文介绍了打字稿混淆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何工具或 TypeScript 分支来支持公共命名空间混淆?IE.转:

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

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

变成类似:

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)

推荐答案

我有完全相同的问题,被 SO 立即删除.

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.

这篇关于打字稿混淆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆