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 !
Sign in to like this content
Please check these articles
Hope that helps you!
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.
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.
Try to update your clientlibrary 'jsprocessor' property with below.
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 -
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-
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.