AEM 6.5.2 JS files are not minified with gcc and yui | Community
Skip to main content
Level 3
May 14, 2020

AEM 6.5.2 JS files are not minified with gcc and yui

  • May 14, 2020
  • 2 replies
  • 34348 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Ankur_Khare
Community Advisor
Community Advisor
May 14, 2020

Could you please try to minify your js here-

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

 

If it works here then we can check in aem , nor it should not work online only there must be some error in your js file, due to which you are not able to minify the js.

Level 3
May 14, 2020
Thank you for your response. I tried minifying using the free formatter and it throws an error in JS files. Basically it throws an error in lines which used "let" keyword. Does min:gcc not support let?
Theo_Pendle
Level 8
May 14, 2020

Hi @divyas70997717 ,

I see that you are trying to use ECMASCRIPT6 as an option for gcc.

"gcc" stands for Google Closure Compiler. There seems to be no ECMASCRIPT6 option for languageIn, you'll have to pick one from the following list (which I got from the documentation on GCC's GitHub page😞

ECMASCRIPT3 ECMASCRIPT5 ECMASCRIPT5_STRICT ECMASCRIPT6_TYPED (experimental) ECMASCRIPT_2015 ECMASCRIPT_2016 ECMASCRIPT_2017 ECMASCRIPT_2018 ECMASCRIPT_2019 STABLE ECMASCRIPT_NEXT

ECMASCRIPT_2015 is equivalent to ES6 btw: https://www.w3schools.com/js/js_es6.asp

Hope this helps, let me know  🙂

Level 3
May 14, 2020
Thank you for your response. I have already tried ECMASCRIPT_2015 and also with other options. It did not work out so i have used ECMASCRIPT6 option.