Minifying not working for Cloud environments | Community
Skip to main content
November 14, 2024
Solved

Minifying not working for Cloud environments

  • November 14, 2024
  • 4 replies
  • 1048 views

Hi everyone,

 

I´m trying to minify the clientlibs for my AEM cloud project. I achived the goal in my local environment by adding the next osgi config:

com.adobe.granite.ui.clientlibs.impl.HtmlLibraryManagerImpl.cfg.json

 

{
"htmllibmanager.minify": true,
"htmllibmanager.gzip": true,
"htmllibmanager.debug": false,
"htmllibmanager.processor.js": [
"min:gcc;obfuscate=true;languageIn=ECMASCRIPT_NEXT;languageOut=ECMASCRIPT_NEXT;compilationLevel=simple"
],
"htmllibmanager.processor.css": [
"min"
],
"htmllibmanager.timing": false
}

In my local environment it is working fine (both publish and author instance). However when this config is deployed to a cloud environment (development and also tried in rde) it seems to do nothing, the clientlibs are not minified. I have checked the osgi config in the cloud environments via developer console and it is correctly deployed. 

 

Has anybody faced anything similar? There is something that is blocking the minify in this environments?

 

Thank you all in advance for your help 🙂

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 Manu_Mathew_

@developer_anon Have you tried Rebuild Client Libraries- /libs/granite/ui/content/dumplibs.rebuild.html also verify client library configuration is set to allowProxy="true". Also ensure the config changes are deployed into cloud. Clear dispatcher cache If needed. 

4 replies

TarunKumar
Community Advisor
Community Advisor
November 14, 2024

Hi @developer_anon ,

 

Please check error.log file there you might see some error associated with that clientlibs. Also, are you seeing "min" extension for your clientlib file?

 

-Tarun

 

November 14, 2024

Yes, we have tried the logs but there is no info in there. And yes, the clientlibs has the ".min.js" extension, but they are not minified at all.

h_kataria
Community Advisor
Community Advisor
November 14, 2024

Try to cross check once if the osgi config is deployed properly using developer console.
Also, it could simply be a cache issue. Please try to hit the entire URL directly with some query param. www.yourdomain.com/etc.clientlibs/your-clietnlib.min.js?q=x 

Manu_Mathew_
Community Advisor
Manu_Mathew_Community AdvisorAccepted solution
Community Advisor
November 23, 2024

@developer_anon Have you tried Rebuild Client Libraries- /libs/granite/ui/content/dumplibs.rebuild.html also verify client library configuration is set to allowProxy="true". Also ensure the config changes are deployed into cloud. Clear dispatcher cache If needed. 

kautuk_sahni
Community Manager
Community Manager
November 26, 2024

@developer_anon Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Kautuk Sahni