Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Minify JS and CSS without "CQ Html Library Manager "minify" option in configuration

sunily21159739
Level 2
Level 2

Hi All,

Please suggest how can I minify my JS,CSS files without using "CQ Html Library Manager" minify option. I have don't have access to use "minify" option in the configuration. What is the alternate solutions, I am using AEM6.4.

 

 

Regards,

0 Replies
BrianKasingli
Community Advisor
Community Advisor

In some scenarios, utilising the "CQ Html Library Manager" to minify your client library CSS and JS actually breaks your FE applications, so you can turn the "CQ Html Library Manager" off (disable) and minify the CSS and JS files during the compilation stage within the build process of your FE application.

NPM packages used to compress JavaScript and CSS files:

Javascript:

CSS:

Additionally, you can utilise Google's Page Speed NGINX or Apache Module to group-minify or minify CSS and JS files, https://developers.google.com/speed/pagespeed/module

 

sunily21159739
Level 2
Level 2

HI @BrianKasingli  thanks for your response, what about "WebPack" for JS/CSS minification , is it good practice to use all these third party libraries to minify the JS/CSS.

What is the process to use these services, how can I implement with our AEM application for minify.

BrianKasingli
Community Advisor
Community Advisor

You can follow the configuration on how AEM Project Archetype has been implemented. They have good samples on how you can get yourself set up, https://github.com/adobe/aem-project-archetype/tree/master/src/main/archetype/ui.frontend.general