Expand my Community achievements bar.

AEM 6.5.2 JS files are not minified with gcc and yui

Avatar

Level 3

Hi,

 

JS minify is not happening in AEM 6.5.2 instance for our project. I tried with gcc (min:gcc;languageIn=ECMASCRIPT6) with Adobe Granite HTML Library Manager and also tried with default minify (min:yui). Both seems not working.

 

Thanks in Advance.

24 Replies

Avatar

Level 4

Finally, in AEM 6.5.8, the javascript uses apach rhino 1.7.7.1_1:

<dependency>

<artifactId>org.apache.servicemix.bundles.rhino</artifactId>

<version>1.7.7.1_1</version>

<groupId>org.apache.servicemix.bundles</groupId>

<scope>provided</scope>

</dependency>

 

Which has a bug for arrow function and it was release in 2017, after we change this bundle to:

<dependency>

<artifactId>org.apache.servicemix.bundles.rhino</artifactId>

<version>1.7.7.2_1</version>

<groupId>org.apache.servicemix.bundles</groupId>

<scope>provided</scope>

</dependency>

Just one small release upgrade, then problem resolved for the js compiler report syntax error for arrow function problem fixed.

You can write a simple java class to validate this.

But anybody knows this will break AEM support policy? Will Adobe care about this upgrade made by us?

 

Avatar

Level 4

in AEM 6.5.8, it uses mozilla rhino package with is ages older, that's why the ecmascript 6 arrow function cannot be parsed and report syntax error. AEM 6.5.9 has the latest and works out of the box.

 

Avatar

Level 8

I have a issue with minification one clientlib-postload.js file isnt minifying the other js files are minifying correctly.

I tried manually minifying its throwing errors while compiling

-1:
Original Post Data:
output_format=json&output_info=compiled_code&output_info=warnings&output_info=errors&output_info=statistics&compilation_level=SIMPLE_OPTIMIZATIONS&warning_level=default&output_file_name=default.js&js_code

Avatar

Level 2

Hi EveryOne,

We should make sure that there should not be any error in JS files by checking at https://closure-compiler.appspot.com/home  and we can use jsProcessor as "min:gcc;languageIn=ECMASCRIPT_2016;languageOut=ECMASCRIPT_2016;compilationLevel=simple;obfuscate=true" at default Adobe Granite HTML Library Manager (com.adobe.granite.ui.clientlibs.impl.HtmlLibraryManagerImpl), then its minifying the JS files.

 

Can someone please let me know how to minify the CSS files at AEM6.5 and for cssProcessor  with "min:yui" is not minifying the CSS files.

 

Regards,

Surendra k