How to use a different minification library for AEM client libraries than the default YUI Compressor library?


AEM 6.4,6.5


In AEM, you can swap out yui engine with GCC (Google Closure Compiler 

For example, see these client library nodes that use GCC for js:



If you want to implement your own custom script processor, then you would implement this java interface:

Related javadoc: 

This allows you to define ScriptProcessors that can modify script sources:

  • the processors are configurable with options
  • the processor can be used for minification, but also for non-minified cases


  • The default ScriptProcessors options can be set via the HTML Library Manager OSGi configuration (in the /system/console/configMgr UI).


Options for GCC are:

  • failOnWarning (defaults to "false")
  • languageIn (defaults to "ECMASCRIPT5")
  • languageOut (defaults to "ECMASCRIPT5")
  • compilationLevel (defaults to "simple") (can be "whitespace", "simple", "advanced")