Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

source code visible in the production : create react app

we are using create react app and converted the source js files into chunks. but I can see that chrome inspect source tab shows the actual code. Is this expected behavior ? Or is there any build configuration that I need to configure to that further ? I have attached an image of the result. minified

like image 299
kulls Avatar asked Oct 18 '25 07:10

kulls


1 Answers

The source code what you see is loaded from the map files as you can see it from the console

enter image description here

You can remove map files from your production server.

Add GENERATE_SOURCEMAP=false in your .env file, so build will not create map files

like image 109
kiranvj Avatar answered Oct 19 '25 22:10

kiranvj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!