An Interest In:
Web News this WeekSearch Archive
Some of Our Sources
- Vandelay Design
- You The Designer
- Creative Curio
- FanExtra - PSD
- My Ink Blog
- 24 Ways
- Dev To
React souce code visible
Do you know that when you deploy your React application which is created using -- or your own webpack configuration to a live website like Netlify, Vercel, Heroku etc, your entire source code is visible to everyone from the sources tab of the developer toolbar as shown in the screenshot of this post.
This is not an issue with the -- but all of the source code is added because of the source map
But you definitely don't want everyone to see your entire source code If it's a private repository or you're working on a client project.
There is an easy way to fix it.
Create a file with the name .env in your project folder with the below code inside it
so when you run or command from the terminal,
It will generate a folder with minified files without a source map that you can deploy to the production.
Connect with me for more tech related information Twitter
Original Link: https://dev.to/dhanushxeno/react-souce-code-visible-4e57