1

Is it possible to hide constant variables in react js ... I have used .env file but after the 'npm run build' constants mentioned in .env visible in dev tools->source section

Is any other method or way is there to hide constant from dev tools?

I have tried with .env & ignore it from git by mentioning .env in .gitignore.

But after npm run build & using obfuscation in react; constant variables are still visible when try to get details from developer tools -> Source.

  • I have tried the ways mentioned in below site: https://www.dhiwise.com/post/how-to-hide-javascript-source-code But using ways, react code get basic minified but constant variables gets visible in developer tools -> source -> main.js file Pls help on this.... – Ishant Mirage Apr 04 '23 at 05:12

1 Answers1

0

No.

It's just the idea of ​​javascript: code executed by the client, the client must know what is being executed