Closed rossmc closed 3 years ago
@rossmc we are working on this right now, wondering if you got far with automating a smaller common bundle?
Hey, unfortunately it just the way it is with Magento as the majority of those files are core ones. MagePack is simply looking which modules has been loaded on a page and bundles them so it has nothing to do with actual usage coverage.
I was doing some work to improve frontend perf in Magento itself, some of it were released, some closed, some is still developed by other people as I'm no longer working on this platform. You can find the list here: https://github.com/magento/magento2/issues?q=label%3A%22Area%3A+Perf%2FFrontend%22 but I think you will see that updating Magento to a newer version would be a first step.
I think Willem's @wigman line from his talk at Reacticon 2020 sums things up beautifully
Google does not like your 4+ MB of JS, nor your 1MB of CSS. You can polish it and stick a flag in it. But this pile of JS doesn't get prettier.
Hi @davidwindell & @krzksz , yes I see this issue is coming more from Magento. Thanks for looking into it.
Hi @davidwindell & @krzksz, Magento's default JS bundling has a feature to exclude some of the rare used Js using theme's view.xml using
Magento has already excluded a few of its default js in Magento blank & luma theme's view.xml file. Ref: JavaScript Bundling Is there any such feature with magepack JS bundling? Eagerly needed its feature to optimize my bundles.
I'm getting the below advice from lighthouse to Remove unused JavaScript and the highlighted file is
bundle-common.min.js
.<img src="https://user-images.githubusercontent.com/2452991/100646748-b86be600-333e-11eb-9349-84cc6bd3c825.png" alt="lighthouse score" title="A cute kitten" width="450" />
Some details...
I'm using magepack v2.3.2.
Below is my projects
magepack.config.js
.