0

We have a multiple file/module based application. We are using r.js with uglify2 to optimize the build. It current does whitespace removal and minification which is great.

Requirement - Can we somehow obfuscate function names used in a file such that other RequireJS modules which are including this custom file do not break and continue to use the "obfuscated" function names?

Many thanks!

Ashish Singh
  • 1,004
  • 11
  • 23
  • The process of minification renames local variables, so it obfuscates most of your code. But a module's API should never be obfuscated... How do you plan on communicating with it then? – Salketer Jun 13 '16 at 08:12
  • Thanks @Salketer. I agree. The app is not open for any public api access. If the obfuscated API names can be somehow preserved in the dependent modules, wouldn't it work? – Ashish Singh Jun 13 '16 at 08:17
  • I am not aware of any obfuscation tool that does it so you would need to build one I guess... And really, what is so bad about having function names in plain? "getClientData()" does not help someone a lot in engineering your logic... Also, obfuscation will only slow theft only by a bit... Maybe you'd like the community's answers on http://stackoverflow.com/questions/4766834/how-do-i-protect-javascript-files – Salketer Jun 13 '16 at 08:23
  • Actually, although I did look up docs and references, I wasn't aware if any option to achieve what I intended exists or didn't. If there was any, I wanted to enable it and I was looking for feedback from people like you. So, thanks a lot :) – Ashish Singh Jun 13 '16 at 09:48
  • you're welcome. What we do here at work is simply use client-side javascript for display logics, and keep our real knowledge and power server-side... And we use copyrights! – Salketer Jun 13 '16 at 10:18
  • In our case, the app works as an add-on on a closed customer platform. So, it is a pure JS application with proprietary logic. We are using copyrights but also looking for a way which can help minimize the code inspections. – Ashish Singh Jun 13 '16 at 10:27

0 Answers0