DEV Community

Discussion on: React source code visible 😲

Collapse
 
wpq profile image
Wpq

Ultimately the client code must run on the client so there is no way to make sure that your code stays private.

You can of course obfuscate/minify/uglify it but must not rely on its secrecy (especially from a security perspective)

Collapse
 
thinkjrs profile image
Jason R. Stevens, CFA • Edited

Similar to my thoughts: anyone with access to the client endpoint necessarily has access to the source. And removing the sourcemap is merely a cosmetic choice with no real source security improvement.

Collapse
 
wpq profile image
Wpq

This is also one of the reasons to never trust the client with anything you cannot control on the server side (typically a bearer)