Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obfuscation by using UglifyJS2 #150

Closed
skotchio opened this issue Mar 13, 2013 · 6 comments
Closed

Obfuscation by using UglifyJS2 #150

skotchio opened this issue Mar 13, 2013 · 6 comments

Comments

@skotchio
Copy link

I know that UglifyJS is good for minimization but I need to Obfuscate fully like Closure Compiler do. Is it possible with UglifyJS?

@Skalman
Copy link
Contributor

Skalman commented Apr 4, 2013

What do you mean? I believe the goal of Closure Compiler is to minify, just like for UglifyJS.
That said, Closure Compiler has a setting "advanced", where it makes a lot of assumptions about the code in order to further minify, e.g. properties (my_var.my_property -> a.b). Is that what you mean by obfuscation?
UglifyJS doesn't support that - it acts similar to Closure's "simple" option.

@skotchio
Copy link
Author

skotchio commented Apr 4, 2013

Thanks for the reply. Yes I mean this. Ok but does uglifyjs support mangle of "private" variables that starts with underscore?

There is pull request in uglifyjs #309
Can you apply this patch to uglifyjs2 ?

@Skalman
Copy link
Contributor

Skalman commented Apr 4, 2013

You should probably separate "variables" and "properties". You're talking about "private" properties. As you can see from a the this comment on the pull request, a lot of assumptions have to be made about the code, probably breaking a lot of code. For code that's a bit more complex, "advanced" requires lots of annotations, and often compiling code twice breaks it.

E.g. the jQuery project decided that it wasn't worth trying to conform to how that works. If you need smaller code, consider refactoring by using "project-global" variables and functions.

@me-ascii
Copy link

me-ascii commented Sep 3, 2014

+1 any updates?

@rvanvelzen
Copy link
Collaborator

UglifyJS does minification, not obfuscation.

As the main concern is about shorter property keys, I'm closing this in favor of #81.

@napstercake
Copy link

Maybe this can help to someone's that the bosses says: "Should be obfuscated". https://www.npmjs.com/package/obfuscator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants