Home > front end >  How I hide react code from browser console?
How I hide react code from browser console?

Time:08-03

Does anyone know how to hide the code displayed in the browser console?

I use in package.json GENERATE_SOURCEMAP=false and set \"GENERATE_SOURCEMAP=false\" && react-scripts build and run npm run build and delete the .js.map files but it doesn't work...

CodePudding user response:

if you use create-react-app, create a .env file in the root of the project and paste in GENERATE_SOURCEMAP=false

CodePudding user response:

in package.json file as follows. add GENERATE_SOURCEMAP=false to build

CodePudding user response:

Create a file called .env in the src folder then add this code GENERATE_SOURCEMAP=false

  • Related