Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Enable Minify only for few ClientLibs

sunily21159739
Level 2
Level 2

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

1 Accepted Solution
gargsahil099
Correct answer by
Level 4
Level 4

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.

View solution in original post

2 Replies
jbrar
Employee
Employee

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
Correct answer by
Level 4
Level 4

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.

View solution in original post