Hide Your Source Code from Developer Tools while using React

Siddhant Khare - Dec 6 '21 - - Dev Community

If you are building a Product using React & using create-react-app boilerplate to get started.

I have seen this mistake doing by many of the Startups i got offer for different roles and by some great products.

Here's One Thing you need to change. That, Source Code that is written by you or the developer team should not be visible to the client.

And, To Hide Your Source Code in Developer Tools, just update this one line in your package.json file.




"build": "GENERATE_SOURCEMAP=false react-scripts build"



Enter fullscreen mode Exit fullscreen mode

Demo On GitHub

Before Adding that Line:

React Source Code Visible in Developer Tool

After Adding that Line:

Hide Source Code in React

Some More Modern Frameworks Like next.js have fixed this issue in their boilerplates.

Live Demo: https://dont-use-default-boilerplate.vercel.app/

Source Code on GitHub: https://github.com/Siddhant-K-code/dont-use-default-boilerplate

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player