Expand my Community achievements bar.

SOLVED

Exclude clientlibs from AEM Minifications

Avatar

Level 1

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

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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.

View solution in original post

3 Replies

Avatar

Employee Advisor

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#.YoI.... I did the same thing in my last project on specific client lib.

 

Here you could see I did for css -

 

DEBAL_DAS_0-1652706736076.png

 

Avatar

Level 1

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

Avatar

Correct answer by
Employee Advisor

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.