Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

using es6 function not working after the minify


Level 2

Hello guys,


I have an issue regarding using ES6 functions which is after minifying the JS, it seems it doesn't support it. Any input is appreciated. Thank you ! 

5 Replies


Employee Advisor

Hi @AEMStarterNewbie ,


Are you generating a webpack sorta js and adding the same to the clientlibs and post that the code is not working fine?

You can override the default aem minification by adding following property in ClientLibraryFolder:


Let me know if that doesnt help or there is a gap in my understanding.




Community Advisor

Yes, I have run into the same issue, minification to ES6 scripts & functions is coming up with a blank file.

As @milind_bachani  suggested, you can either turn off minification through js:Processor property. 

A drawback with that would be, your code would be AS-IS and unminified which can be acessed through the dev console of browsers.

To solve this issue, you can place your script in the ui.frontend module and build it through webpack. Use babel and minifify during building itself.

Then you can turn off minification in AEM(CRX) and you would have minified code.


Level 8



Try to update your clientlibrary 'jsprocessor' property with below.





Employee Advisor


Please check error.log file there you might see some error associated with that clientlib.

When I had issue with minification , I saw error message in error.log file and then I took necessary steps to fix.



To troubleshoot the issue please follow the below steps   -


a. AEM 6.5 uses following closure-compiler-v20190121.jar for js minification, also highlighted in below screenshot -




b. If we take a closure look , we could see com.google.javascript is part of this closure compiler bundle.

c. Next you  can download the bundle:closure-compiler-v20190121.jar from aeminstance\crx-quickstart\launchpad\felix\bundle290\version0.0\bundle.jar-embedded. Bundle ID may vary in your case-




d. To understand the minification issue , you can execute below command to compile the Javascript file -

     java -jar compiler.jar --js hello.js --js_output_file hello-compiled.js

Getting Started with the Closure Compiler Application  |  Google Developers


It may throw error during compilation and it will help you why minification isn't working.


In my project Front End developers do the minification outside as part of the Frontend build process; Front End devs would not rely on the AEM features, because there are better ways and tools to do so.