Here we will talk more details about clientlibs
Static Resources in clientlibs
Static resources below the client library folder must be in a folder called resources. If you do not have the static resources, such as images, under the folder resources, it cannot be referenced on a publish instance. Here is an example: http://localhost:4503/etc.clientlibs/geometrixx/components/clientlibs/resources/example.gif
allowProxy = true
It is recommended to locate client libraries under /apps and expose them via /etc.clientlibs by leveraging the allowProxy property.
In order for the client libraries under /apps to be accessible, a proxy servlet is used. The ACLs are still enforced on the client library folder, but the servlet allows for the content to be read via /etc.clientlibs/ if the allowProxy property is set to true.
A static resource can only be accessed via the proxy, if it resides below a resource below the client library folder.
As an example:
You have a clientlib in /apps/myproject/clientlibs/foo
You have a static image in /apps/myprojects/clientlibs/foo/resources/icon.png
Then you set the allowProxy property on foo to true.
You can then request /etc.clientlibs/myprojects/clientlibs/foo.js
You can then reference the image via /etc.clientlibs/myprojects/clientlibs/foo/resources/icon.png
When using proxied client libraries, the AEM Dispatcher configuration may require an update to ensure the URIs with the extension clientlibs are allowed.
A preprocessor configuration on the clientlib node takes precedence over the OSGI configuration (HTML Library Manager OSGi configuration).
Format and Examples
config:= mode ":" processorName options*; mode:= "default" | "min"; processorName := "none" | <name>; options := ";" option; option := name "=" value;
YUI Compressor for CSS Minification and GCC for JS
cssProcessor: ["default:none", "min:yui"] jsProcessor: ["default:none", "min:gcc;compilationLevel=advanced"] Typescript to Preprocess and Then GCC to Minify and Obfuscate jsProcessor: [ "default:typescript", "min:typescript", "min:gcc;obfuscate=true" ]
Additional GCC Options
failOnWarning (defaults to "false") languageIn (defaults to "ECMASCRIPT5") languageOut (defaults to "ECMASCRIPT5") compilationLevel (defaults to "simple") (can be "whitespace", "simple", "advanced")
For further details on GCC options, see the GCC documentation.