siddharth khuntwal
Siddharth Khuntwal

Siddharth Khuntwal

How To Hide Your Source Code When Using ReactJS?

How To Hide Your Source Code When Using ReactJS?

siddharth khuntwal's photo
siddharth khuntwal
·Jul 30, 2022·

1 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

Whenever you are building any project or product for your startup using React, obviously you don't want to make your source code visible to customers or clients.

I have been working on React for quite some time now and I have seen many times that the source code is clearly visible in the Developers Tools, This is a common mistake which I have seen very frequently.

So If you are building your project using React & using the create-react-app boilerplate to get started. You need to do one thing to hide your source code from the developer's section, just update this in your package.json file.

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

Voilà, Now your source code is hidden*

14zf4sfg6mmm7mhumsow.png

 
Share this