Enable Minify only for few ClientLibs | Community
Skip to main content
sunily21159739
January 9, 2020
Solved

Enable Minify only for few ClientLibs

  • January 9, 2020
  • 2 replies
  • 2096 views

Hi All,

I am working in AEM6.4.2. There two applications are running on same AEM instances and one of the application is not using minification of Js/Css thats why they have disabled "minify" option on configuration level.

I am using minification version of our css and  when I am deploying my application on same instance, I am getting css issue because "minify" option is disabled. If I will enable it then everything's are working fine but first application start breaking.

Please let me know how can I enable "minify" only for my ClientLibs.

I know, we can disabled "minify" for particular ClientLibs by :

jsProcessor String[] default:none, min:none

cssProcessor String[] default:none, min:none

 

I am looking for vice versa,wants to enable minify for particular ClientLibs. Please suggest.

 

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by gargsahil099

Hi Sunil,

 

You can try to use the below properties on node as they always have more precedence then OSGI configuration. Just disable the OSGI minification configuration and add the below properties on client lib node

cssProcessor: ["default:none", "min:yui"]
jsProcessor: ["default:none", "min:gcc;compilationLevel=advanced"]

 

Regards

Sahil garg.

2 replies

Adobe Employee
January 9, 2020

You can choose to configure the preprocessors configuration per clientlibrary or system-wide.

  • Add the multivalue properties cssProcessor and jsProcessor on the clientlibrary node
  • Or define the system default configuration via the HTML Library Manager OSGi configuration

A preprocessor configuration on the clientlib node takes precedence over the OSGI configuration.

Format and Examples
FORMAT
 
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")
gargsahil099
gargsahil099Accepted solution
January 10, 2020

Hi Sunil,

 

You can try to use the below properties on node as they always have more precedence then OSGI configuration. Just disable the OSGI minification configuration and add the below properties on client lib node

cssProcessor: ["default:none", "min:yui"]
jsProcessor: ["default:none", "min:gcc;compilationLevel=advanced"]

 

Regards

Sahil garg.