DEV Community

Discussion on: Hide Your Source Code from Developer Tools while using React

Collapse
 
vaibhavpandeyvpz profile image
Vaibhav Pandey

Source maps are essential for debugging in the event of error reports. The mistake is actually not in generating them but to publish them to production server. Take for e.g., docs.sentry.io/platforms/javascrip... Sentry support demangling of symbols using sourcemaps generated during build.

Collapse
 
siddhantkcode profile image
Siddhant Khare

Yeah, I had the same point that mistake is to take sourcemaps to Prod. That's why I added the sourcemap false script to to the build script and not to the development script

Collapse
 
vaibhavpandeyvpz profile image
Vaibhav Pandey

There's is nothing wrong in building it in production. You ideally should build it, you can't use development sourcemaps to trace errors in production builds. The key is to exclude them from the publishing part.