6

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).

2
  • Please share with us if any solution found by you for this because we are also struggling with high volume of JS. Commented Dec 14, 2019 at 12:31
  • @VishV Our solution was to abandon Magento and never look back; a solution I highly recommend.
    – WackGet
    Commented Apr 6, 2022 at 20:45

1 Answer 1

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/

1
  • 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
    Commented May 4, 2019 at 23:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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