Client Library Configuration: Minify and Debug

CQ Client Libararies (clientlibs) contain two configuration options that every developer should be aware of: minify and debug.

Steps:

Navigate to Tools
Navigate to OSGi Console
Search for and click on "Day CQ HTML Library Manager"

clientlib_config

Minify:

Do not put any minified code into your clientlib codebase. Let AEM handle it automatically in non-development environments by clicking the “Minify” checkbox.

Debug:

Developers, check the “debug” option on your local instance. This will prevent the CQ clientlib files from being combined into one file, and makes troubleshooting javascript and css issues significantly easier.

Warning: page layout and css may look a bit more “choppy” when initially loading.

Note: AEM may require being restarted to apply changes to these settings.

Summary:

CQ developers should no longer have to debug through minified, rolled-up client library code by taking advantage of useful configuration options.

8 thoughts on “Client Library Configuration: Minify and Debug

  1. Vishnu

    Please let me know if we will be able to implement Minify for HTML file types from Adobe CQ end or do we need to enable GZIP compression from apache webserver.

    Reply
    1. Nick Matelli Post author

      Minification will be handled entirely by CQ if you set this option. It won’t matter if you have any kind of proxy between your CQ instance and end users, as only the minified file will be transmitted the whole way through.

      GZip compression is different, and should be enabled on all downstream servers. If you have the CQ dispatcher running through Apache, for instance, then gzip compression should be enabled in your Apache config.

      Reply
  2. Nadhir

    Thank you for the great tip.
    the only problem I’m having is that both author and publish instances don’t seem to find my clientlib for the js. (it works locally though). I think the problem is in the minified js.
    any ideas..??
    Thank you.

    Reply
    1. Nick Matelli Post author

      Hi Phil. I thought it removed line break characters by default, but if not, there is an option to specify that kind of behavior in the library that AEM uses: –line-break. The documentation for that is here: http://yui.github.io/yuicompressor/. I’ll have to research where to plug in those parameters, but it should configurable in AEM.

      Reply
        1. Upasana

          The line-break parameter is not configurable in AEM yet. YUI takes line-break as a hardcoded 0 value 🙂

          Reply

Leave a Reply to Upasana Cancel reply

Your email address will not be published. Required fields are marked *