Clientlibs not getting minified in AEM 6.5.6 | Community
Skip to main content
Level 2
May 18, 2022
Solved

Clientlibs not getting minified in AEM 6.5.6

  • May 18, 2022
  • 3 replies
  • 4956 views

The .min.js extension is getting added to the client library , but the js files are not minified.
AEM version: 6.5 and service pack version is 6.5.6.
In OSGI config HTML client library manager, minify option is already enabled with jsProcessor= min:gcc 

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 joerghoh

Can you elaborate on the Frontend build process please


The standard AEM archetype provides a pre-defined structure for the frontend build already, see https://experienceleague.adobe.com/docs/experience-manager-core-components/using/developing/archetype/using.html?lang=en#what-you-get

 

specifically the modules "ui.frontend.general", "ui.frontend.react" and "ui.frontend.angular"

3 replies

DEBAL_DAS
New Member
May 18, 2022

Steps:1

Please check error.log file there you might see some error associated with that clientlib.

When I had issue with minification , I saw error message in error.log file and then I took necessary steps to fix.

 

Step:2

To troubleshoot the issue please follow the below steps   -

 

a. AEM 6.5 uses following closure-compiler-v20190121.jar for js minification, also highlighted in below screenshot -

 

b. If we take a closure look , we could see com.google.javascript is part of this closure compiler bundle.

c. Next you  can download the bundle:closure-compiler-v20190121.jar from aeminstance\crx-quickstart\launchpad\felix\bundle290\version0.0\bundle.jar-embedded. Bundle ID may vary in your case-

 

d. To understand the minification issue , you can execute below command to compile the Javascript file -

     java -jar compiler.jar --js hello.js --js_output_file hello-compiled.js

[https://developers.google.com/closure/compiler/docs/gettingstarted_app]

It may throw error during compilation and it will help you why minification isn't working.

 

 

 

Debal Das, Senior AEM Consultant
nitin029Author
Level 2
May 18, 2022

Hi @debal_das ,
I checked the bundles that you have mentioned and I saw that closure-compiler-v20190121.jar  is not being used in my case for minification. Instead of that, .,yuicompressor-2.4.8-granite-003.jar is being used. Any suggestions on how to bring closure-compiler-v20190121.jar  instead of  .,yuicompressor-2.4.8-granite-003.jar ?

 

 

 

nitin029Author
Level 2
May 18, 2022

Are you seeing Adobe Granite UI Clientlibs - Google Closure Compilercom.adobe.granite.ui.clientlibs.processor.gcc in /system/console/bundles like the below one -

 


Hi @debal_das ,

I have looked into the same one as mentioned by you and I am also having the same 

closure-compiler-v20190121.jar like you have mentioned.
Can you help me with the next steps.

Thanks!

joerghoh
Adobe Employee
Adobe Employee
May 18, 2022

I would do the minification outside as part of the Frontend build process; I would not rely on the AEM features, because there are better ways and tools to do so.

 

(Note: hearsay, I am not a frontend engineer)

DEBAL_DAS
New Member
May 19, 2022

Yes @joerghoh , in our current and last project minification is part of Frontend build process.

Debal Das, Senior AEM Consultant
nitin029Author
Level 2
May 19, 2022

Can you elaborate on the Frontend build process please