I added a custom JS file, that is located under the following:


But when I run a speedtest, that file is not compressed and loaded into the Magento merged JS file. It is just loaded outside the merged file.

How can I add this file, so that it will be added to the merged JS?


How did you make Magento load your javascript file? Make sure you add the Javascript file correctly inside a layout Xml file:

<?xml version="1.0"?>
        <reference name="head">
            <action method="addItem">

Remove the existing merged Javascript file, clean cache so Magento regenerate the merged Javascript file.

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.