1

n my react app, when I run npm run build then lot of chunk files are created and also one main.[hash].js file and that main.[hash].js file size is ~138kb (attached screenshots below for reference) enter image description here

Due to this performance of my app is getting low as per PageSpeed test or LightHouse test (attached screenshots below for reference) and its in Reduced unused Javascript And in react app there's no such code which are unused

enter image description here

So how to reduce size of main.[hash].js file so that performance will increase ?

In this app I did not eject web-pack files so there no config file in this app also I have already use code splitting technique like lazy/suspence in all routes.

Yuvraj Chaudhari
  • 191
  • 1
  • 2
  • 10
  • What have you tried? Did you click on Learn More? Did you view the script in the Treemap viewer to discover possible unused code? – Connor Clark Jul 03 '22 at 00:04
  • @ConnorClark I had tried it. I have already used lazy loading in landing page as well as all routes but still not effect on main.js – Yuvraj Chaudhari Jul 03 '22 at 11:03

0 Answers0