January 2, 2021
Estimated Post Reading Time ~

How to disable the minification for client libraries in AEM?

Minification refers to the process of removing unnecessary or redundant data without affecting how the resource is processed by the browser — e.g. code comments and formatting, removing unused code, using shorter variable and function names, and so on.

Minification helps to reduce the size of the resources(JavaScript and CSS) and improves the performance of page loading.

Sometimes we may be required to disable the minification for specific Java script files may be due to the files are already minified or the issue with the minification process.

There are two options to disable the minification for Java Scripts and CSS in AEM

Disable through Adobe Granite HTML Library Manager — Disable the minification globally for JS and CSS, this will impact all the client libraries in the system(both default and custom)

Disable Minification for specific client libraries — Disable the minification for specific client library — JS/CSS, this will impact only the specific client library where this configuration is enabled.
Disable through Adobe Granite HTML Library Manager

Un-select minify option in Adobe Granite HTML Library Manager through ConfigMgr(http://localhost:4502/system/console/configMgr/com.adobe.granite.ui.clientlibs.impl.HtmlLibraryManagerImpl)


Please note this is a global configuration and it will impact all the client libraries, non of the client libraries will be minified now and this will impact the performance. This approach is not recommended as this will disable the minification for all the custom and default system-level client libraries.
Disable Minification for specific client libraries

Enable the minification in global configuration(Adobe Granite HTML Library Manager) — http://localhost:4502/system/console/configMgr/com.adobe.granite.ui.clientlibs.impl.HtmlLibraryManagerImpl and disable the minification for required client libraries in the client library level. This will only disable the minification for the specific client library.


To disable the minification for a specific client library add the below properties to the client library node.

To disable Java Script Minification — add jsProcessor String[] default:none, min:none


To disable CSS Minification — add cssProcessor String[] default:none, min:none


Disabling the minification at a global level is not recommended as this will impact the overall impact of the website performance, enable the configurations to required client libraries to disable the minification for JS/CSS.


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.