Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prod build of React App allows React Dev Tools and show components in source tab inside Browser

Tags:

Actually, I'm developing a React App and I'm using React Script 2.0 to build it. The weird thing is after I compiled with the react-scripts build command and serve the app with Nginx I'm still allowed to check the state with React Dev Tools, also if I go to Source in Chrome I can see my components as if they weren't compiled.

Does anyone know what I'm doing wrong?

enter image description here

like image 843
Luis Chavez Avatar asked Mar 01 '19 16:03

Luis Chavez


1 Answers

Just add GENERATE_SOURCEMAP=false in you .env file then it will stop making *.map files and browser will not show folders in source tab
Run this command for create .env file and write GENERATE_SOURCEMAP=false in it

echo GENERATE_SOURCEMAP=false > .env

Happy coding...!

like image 58
Talha Rahman Avatar answered Nov 15 '22 04:11

Talha Rahman