I am trying to improve the lighthouse performance of my nextjs project but I keep on seeing unwanted js being loaded in the webpage. The following image is a screenshot of the coverage
Some chunks of different pages are also being loaded. What can I do to stop the loading of unwanted chunks ? I have explored splitchunkspluggin , removed many unwanted package,used dynamic imports but nothing seems to work. Currently Nextjs v12 and React v17 is being used.
I have done a lot of optimizations on this project but nothing seems to bring any significant change in the project.
This was the earlier build report
but after making some changes the current build report is this
I have tried almost everything I found on the internet like upgrading the nextjs version , making some changes to the splitchunk plugin that is manually splitting some of the chunks , adding prefetch={false} to the component , tried to use dynamic imports from next/dynamic but nothing seems to make any improvements to the performance.