Exclude clientlibs from AEM Minifications | Community
Skip to main content
May 16, 2022
Solved

Exclude clientlibs from AEM Minifications

  • May 16, 2022
  • 1 reply
  • 1385 views

Hi Team,

 

We are working on project where we got a situation to exclude personalized clientlibs i.e., 

etc.clientlibs/cq/personalization/clientlib/personalization/kernel.min.js from minification, so that only personalization kernel JS is not minified rest all clientlibs are minified. Could you please advise on steps to implement the ask.

 

Thanks

Seran

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by DEBAL_DAS

In that case I won't recommend to add jsProcessor String[] default:none, min:none to disable the minification under /lib.

 

Personally I have seen different implementation to perform minification.

Don't use the AEM OOTB minification configuration and it will disable minification process by default and it won't touch /libs/cq/personalization/clientlib/personalization/kernel.

Then use --style=compressed during npm build in package.json file (if you have) where you need  minification.

 

Frontend team was following this approach in my last project. 

 

Please talk to your architect and Front team and explain everything.

1 reply

DEBAL_DAS
May 16, 2022

In that case please refer Disable Minfication for specific client libraries: in https://www.albinsblog.com/2019/04/how-to-disable-minification-for-client-libraries-in-aem.html#.YoI7zahBw2w. I did the same thing in my last project on specific client lib.

 

Here you could see I did for css -

 

 

Seran1Author
May 16, 2022

Hi @debal_das ,

 

Thanks for your quick response, I want to apply the changes to personalization library under /lib too. Could you please advise if there is other solution or can leverge this solution to personalization libraries under /lib.

 

Thanks

Seran

DEBAL_DAS
DEBAL_DASAccepted solution
May 16, 2022

In that case I won't recommend to add jsProcessor String[] default:none, min:none to disable the minification under /lib.

 

Personally I have seen different implementation to perform minification.

Don't use the AEM OOTB minification configuration and it will disable minification process by default and it won't touch /libs/cq/personalization/clientlib/personalization/kernel.

Then use --style=compressed during npm build in package.json file (if you have) where you need  minification.

 

Frontend team was following this approach in my last project. 

 

Please talk to your architect and Front team and explain everything.