5

Currently my almost-new Magento 2.3.1-based website with a lightly modified theme is sending 170 JavaScript files to the browser, just to serve the home page. To me, this is not remotely acceptable.

Many of these JS files are useless for my website (e.g. ones relating to Amazon Pay, captcha, etc.) and I would like to remove them completely. Frankly I don't even understand why such files are being sent on the home page, which contains no kind of interactive features (it's just a CMS page).

It seems like Magento is sending lots of unnecessary JavaScript "just in case" it needs to be used for the theme.

Is there a reasonably easy way to identify where this extra bloat comes from, and stop it being sent altogether?

(Please note I don't want to use Magento's JS bundling feature but rather I'm looking for ways to stop these JS files being referenced at all).

0

Yes, you can remove unnecessary Magento modules via composer.json

https://www.integer-net.com/removing-unused-core-modules-from-magento-2-the-right-way/

  • Thanks, but even after removing that entire list of modules I'm still seeing the same number of JavaScript files on the frontend. For example, 60 .js files come from the Magento_Ui module. I feel like this is a deeper architectural problem with Magento but I'm open to other solutions. – WackGet May 4 at 23:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.