By default, CRA generates source-maps in production. This slows down the application download time. To disable source maps, the following actions are required:
Create a next extension, declare a before build script inside. It is possible to use an exiting extension too. Follow these instructions:
How to execute logic before build?
To disable source maps, set the GENERATE_SOURCEMAP
variable inside of the before build script:
process.env.GENERATE_SOURCEMAP = 'false';