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) ?
Solved! Go to Solution.
Views
Replies
Total Likes
You can get the jar file by following these steps-
Views
Replies
Total Likes
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)"
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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?
Views
Replies
Total Likes
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);
Views
Replies
Total Likes
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);
Views
Replies
Total Likes
Are you looking in com.adobe.granite.ui.clientlibs-1.0.0.jar ??
Could you upload the JAR file you are referring?
Views
Replies
Total Likes
Are you looking in com.adobe.granite.ui.clientlibs-1.0.0.jar ??
Could you upload the JAR file you are referring?
Views
Replies
Total Likes
You can get the jar file by following these steps-
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
Thanks Kunal.
The line break argument should be passed -1 so that that the resultant minified file has no new line.
************************
if (linebreakpos >= 0 && result.length() - linestartpos > linebreakpos) {
result.append('\n');
linestartpos = result.length();
}
Have figured this out and now it is working
Views
Replies
Total Likes