Minify JS CSS | Community
Skip to main content
October 16, 2015
Solved

Minify JS CSS

  • October 16, 2015
  • 11 replies
  • 4537 views

Turning minify to ON using  com.adobe.granite.ui.clientlibs.impl.HtmlLibraryManagerImpl   is  doing ONLY basic minification. For example carriage return is not removed from CSS and JS

Even obfuscation is also basic.

If there a way to configure the YUI compressor that it uses with advanced parameters for more compression of the statis files (JS and CSS) ?

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 Kunal_Gaba_

You can get the jar file by following these steps- 

  1. Open http://localhost:4502/system/console/bundles/com.adobe.granite.ui.clientlibs
  2. Find the bundle Id on the page 
  3. Go to crx-quickstart/launchpad/felix/bundle<bundleid> folder. You will see bundle.jar in that folder. 

11 replies

cmhdave3266
Level 2
October 16, 2015

What version are you using?  I see an known issue in the Release Notes for 6.0

"Client libs: When using the new 6.0 cachekey feature of the client library, minification is no longer applied to files (CQ-21506)"

October 16, 2015

I am using  6.0.  Its not that it isn't doing minification. 

It is but not doing advanced minification which YUI does.

Any suggestions would be highly appreciated...

 

Thanks

Kunal_Gaba_
October 16, 2015

AEM does use YUI compressor. Check the bundle JAR location of com.adobe.granite.ui.clientlibs bundles in crx-quickstart/launchpad/felix folder and you will find the YUI compressor JAR in it. 

Link to documentation - https://helpx.adobe.com/experience-manager/kb/upgrade-yui-compressor.html

October 16, 2015

I am using AEM 6.0 SP2 which already has latest YUI compressor

Question is how can configure the YUI compressor setting  in AEM ?

Please see the below link which documents things we can configure inYUI 

http://yui.github.io/yuicompressor/   

Does AEM have a way to configure these?

Kunal_Gaba_
October 16, 2015
I couldnt find any configuration or any documentation which specifies how to configure the compressor. You can see in the code below how AEM invokes the YUI compressor. //Signature of YUICompressor compress method public void compress(Writer out, Writer mungemap, int linebreak, boolean munge, boolean verbose, boolean preserveAllSemiColons, boolean disableOptimizations) //and AEM calls it like this compressor.compress(out, 0, true, false, false, false);
cmhdave3266
Level 2
October 16, 2015

Is there a feature you are looking for that you want to enable in particular?  I can see in the code from the above referenced JAR that the YUI compressor is called with this method:

compress(Writer out, int linebreak, boolean munge, boolean verbose, boolean preserveAllSemiColons, boolean disableOptimizations)

with these parameters

compressor.compress(out, 0, true, false, false, false);
October 16, 2015

Are you looking in com.adobe.granite.ui.clientlibs-1.0.0.jar   ??

Could you upload the JAR file you are referring?

October 16, 2015

Are you looking in com.adobe.granite.ui.clientlibs-1.0.0.jar   ??

Could you upload the JAR file you are referring?

Kunal_Gaba_
Kunal_Gaba_Accepted solution
October 16, 2015

You can get the jar file by following these steps- 

  1. Open http://localhost:4502/system/console/bundles/com.adobe.granite.ui.clientlibs
  2. Find the bundle Id on the page 
  3. Go to crx-quickstart/launchpad/felix/bundle<bundleid> folder. You will see bundle.jar in that folder. 
cmhdave3266
Level 2
October 16, 2015

In my CQ 5.6.1 instance it is com.adobe.granite.ui.commons-5.5.76.jar.  I don't have AEM 6.0 installed but if you read that KB article that kunal23 linked above you can find it in your 6.0 installation easy enough.