简体   繁体   中英

How I hide react code from browser console?

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...

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM