React build directory still contain non-minimized js files

I have configured “npm run build” and change publish directory to “build” in my react app.
But when I inspect > source, it still contains non-minimized js file

When I do “npm run build”, in my local machine, it will only show minimized js files inside build folder.
Can I prevent the non-minimized file to be published?

Those are not non-minified files, those are the source maps. They make debugging easier. You can disable the loading of source maps in dev tools settings. However, if you wish to completely disable the generation of source maps, your build script in package.json can be something like this: "build": "GENERATE_SOURCEMAP=false react-scripts build",.

Thank you hrishikesh!

1 Like