Blog

Disabling Javascript Merging in Magento

If you have ever written Javascript for Magento, you have probably been frustrated by the fact that Magento merges all of its JS files before outputting them to the frontend. This makes debugging difficult for a few of reasons:

  • It makes it more difficult to see if your JS file is even being loaded
  • When Firebug (or your JS debugger of choice) logs errors to the console, it's impossible to match up the line numbers Firebug reports with the line numbers in the file
  • If you want to use Firebug's debugging or profiling tools, you're greatly impaired by having all the JS in one file.

A few months ago, one of our developers stumbled across the ability to disable the JS merging in Magento: Go to System > Preferences > Developer > Javascript Settings tab > Set "Merge JavaScript Files" to "No".

DisableJsMerging

I hope this helps in your Magento Javascript debugging!

Posted on March 27, 2010

Posted by Erik Hansen

Add comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.