How to set production mode in react?


You set NODE_ENV=production in the start command or your .env file.

You should also set the key mode to 'production' inside of webpack.conig.js. It will automatically set some optimizations for Webpack. It would also be good if you could use what Gareth said too.