By default, CRA generates source-maps in production. This slows down the application download time. To disable source maps, the following actions are required:

1. Create a new script to run before build

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?

2. Set an environment variable to disable source maps

To disable source maps, set the GENERATE_SOURCEMAP variable inside of the before build script:

process.env.GENERATE_SOURCEMAP = 'false';