Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Enabled minifaction in AEM6.4 seems not be working

Avatar

Level 5

Hello,

 

I've got a request for minify css and javascript files on an AEM6.4 instance. My research in the Internet gave me following sources:

 

https://experienceleague.adobe.com/docs/experience-cloud-kcs/kbarticles/KA-16544.html?lang=us-en

https://experienceleague.adobe.com/docs/experience-manager-64/developing/introduction/clientlibs.htm...

 

The result is the following screenshot from my configuration

 

 configuration_minifaction.png

 

After this I tested it. As concerned to the css files this configuration works, but not for js files. Below an example:

uncompressed_js.JPG

Can somebody tell me what's going wrong?

 

Thanks in advanced for any answers.

1 Accepted Solution

Avatar

Correct answer by
Level 6
0 Replies

Avatar

Correct answer by
Level 6

@Magicr , Please check the link below.

 

ClientLib Minification in AEM 

Avatar

Level 5

Thanks for your answer. I tried it as you suggested and it does not work either. Here the content of my .content.xml file:

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:ClientLibraryFolder"
sling:resourceType="widgets/clientlib"
allowProxy="{Boolean}true"
htmllibmanager.minify="{Boolean}true"
htmllibmanager.gzip="{Boolean}true"
categories="[xxx.yyyy.zzzz.publish]"
jsProcessor="[min:gcc;languageIn=ECMASCRIPT_15;languageOut=ECMASCRIPT_15;compilationLevel=advanced]"
cssProcessor="[min:yui]"
embed="[common.form,coma.analytics.adobelaunch,coma.analytics.siteentry]"/> 

Are there mistakes in there?

Avatar

Community Advisor

Hi @Magicr ,

 

I see there might be an issue with your configuration. There is no languageIn as 'Javascript' as you have specified in "JS Processor Default Configs" property. Also, check if your script is having some issue 

Check here to minimize -

https://www.freeformatter.com/javascript-minifier.html

 

Check this thread, almost same issue.

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-6-5-2-js-files-are-not...

Avatar

Level 5

Thanks for your answer.

I changed the configuration from languageIn=Javascript;languageOut=Javascript to languageIn=ECMASCRIPT_15;languageOut=ECMASCRIPT_15 and it doesn't still work. As you suggested I checked my Javascript at freeformatter.com and it showed me a couple of errors due tue modern language version of ES6. This compiler blamed mostly the word let.

After that I looked at the internet what the abbreviation 'gcc' means. This stands for Google closure compiler. The site of this -https://closure-compiler.appspot.com- offers an compiler where you can minify your code either. On this site there where no problems with my Javascript to minify it. 

 

At one linked post was mentioned to check the logs for errors from gcc processor. After correcting the mistake in configuration I changed the log level to debug. No errors where printed out in error.log. The Javascript still not minified.

Avatar

Level 4

Hi @Magicr 

 

Can you try to parse your JS first with some online tool such as:https://www.freeformatter.com/javascript-minifier.html

May be your JS have some issues.

 

Avatar

Level 5

Thanks for your answer.

As you suggested I checked my Javascript at freeformatter.com and it showed me a couple of errors due tue modern language version of ES6. This compiler blamed mostly the word let.

After that I looked at the internet what the abbreviation 'gcc' means. This stands for Google closure compiler. The site of this -https://closure-compiler.appspot.com- offers an compiler where you can minify your code either. On this site there where no problems with my Javascript to minify it. 

 

At one linked post was mentioned to check the logs for errors from gcc processor. In configuration I changed the log level to debug. No errors where printed out in error.log. The Javascript still not minified.