Search code examples
ecmascript-6aemminify

How to solve minification issue with AEM 6.5 and ECMA Script 6/ javascript 6?


I am working on an AEM 6.5 instance this is a strange issue. I have set minification engine to min:gcc as min:yui is deprecated since 2012.

Now min:gcc in author instance compiles only a few JS files as the others are throwing errors. But in publish instance it's rejecting every JS file for minification.

Now the problem is I can go back to "yui" BUT that throws errors as well and there is nothing much FE can do as the JS files are not directly written by them, they write ES6 code and transpile and give us ES5. This ES5 transpiled code is getting rejected by YUI and GCC both.

How can they fix issues in a file that Babel has generated?

How do I get out of this dilema?


Solution

  • We ended up doing somewhat what Sharath has mentioned in his answer. However I would like to highlight another issue we faced. So to by-pass Adobe Cloud Security warnings we turned on minification service in AEM and individually added ignore property

    jsProcessor="[default:none,min:none]"
    

    adding min:gcc;compilationLevel=whitespace didn't work for use.

    And in the HTML Library OSGi service when we set default js and css processor, setting min:gcc caused default AEM authoring library minification to fail.

    It's best that we either turn off minification in Author OR set js processor to min:yui i.e. the default.