打字稿混淆

打字稿混淆

问题描述:

是否有任何工具或 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.