If an app is created using React's official create-react-app hello-world
, and building it with npm run build
, I often do:
npm run build && rm -f build/static/js/*.js.map
because when the files are transferred to the server using sftp
, I just use
put -r .
to put everything there, and the js.map
file is huge, like 2.7MB for a small project.
It also takes time to build it too, so instead of building it and removing it, is there a way to just not build it?
What Is React? React is a declarative, efficient, and flexible JavaScript library for building user interfaces. It lets you compose complex UIs from small and isolated pieces of code called “components”.
In the inspection tool, click on the gear icon on the very top right of the window to open the settings page as shown below. In the preference tab, under the Sources subheader, make sure that Enable JavaScript source maps is enabled.
In React, the map() function is most commonly used for rendering a list of data to the DOM.
For anyone coming to this question in 2018 and later :
Add the following line in a .env
file at the root of your project.
GENERATE_SOURCEMAP = false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With