What is the best practice- Clientlibs( minify) or Webpack | Community
Skip to main content
sunily21159739
Level 2
Sep 23, 2020 4:17 PM UTC
Solved

What is the best practice- Clientlibs( minify) or Webpack

Hi All,

 

What is the best practice to minify JS/CSS file in AEM6.4.2.

In our case there there two applications are running on same AEM instances and one of the application(First) is not using AEM minification  that's why they have disabled "minify" option on configuration level. They( First Application) want to use WebPack to minify JS/CSS because some of the pages of there application is breaking by using AEM minify option.

 But in our application( second) AEM minify is working fine. Just want to check what is the best practice here, do I need to implement WebPack also in my application( second) or can I continue with AEM minify option(CQ Html Library Manager).

 

Regards,

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
raj_mandalapu
raj_mandalapuAccepted solution
Level 7
Sep 24, 2020 2:00 AM UTC

You can continue with AEM minify option, but the problem I see here is, if AEM is not properly minified your JS due to some issues in js files then there are chances to get production defects that are related to JS, if any issue occurs either in prod or lower environments related to this then you need to spend some amount of time to identify the issue, I feel it is waste of time. 

 

Another approach is, you can ask front end people to minify the JS before adding into the clientlibs. With the tools/plugins currently available in the market for front end people this is not a big task, for them, it is just one additional step.

 

5 replies

arunpatidar
New Participant
Sep 24, 2020 9:21 AM UTC

If AEM minification works you can reply on AEM minify.

The other project can disabled clientlibs minification by using project specific configs
eg. https://www.albinsblog.com/2019/04/how-to-disable-minification-for-client-libraries-in-aem.html

Translate
Arun Patidar
Level 2
Oct 19, 2021 10:52 AM UTC

I am trying achieve minification in aem 6.5, but is not happening.

I tried adding jsProcessor to node level but js is not getting minfied. I tried adding HTML congifugration and selecting clientlibs to not get minified as mention above url, but its not working.

Translate
arunpatidar
New Participant
Oct 19, 2021 8:52 PM UTC

Could you please share your clientlib configuration?

Translate
Arun Patidar
raj_mandalapu
raj_mandalapuAccepted solution
Level 7
Sep 24, 2020 2:00 AM UTC

You can continue with AEM minify option, but the problem I see here is, if AEM is not properly minified your JS due to some issues in js files then there are chances to get production defects that are related to JS, if any issue occurs either in prod or lower environments related to this then you need to spend some amount of time to identify the issue, I feel it is waste of time. 

 

Another approach is, you can ask front end people to minify the JS before adding into the clientlibs. With the tools/plugins currently available in the market for front end people this is not a big task, for them, it is just one additional step.

 

Translate
joerghoh
Employee
Sep 23, 2020 7:23 PM UTC

To be coherent, I would unify the way your frontend is created. Personally I am not in favor of any (I don't build frontends), but as one part is already using webpack, I would think that switching the part also to webpack isn't that hard (you already have some experience in your team how it works).

Translate