Introduction
There are two types of processors in Wro4j:
- Pre Processors - executed on a resource before the merge
- Post Processors - executed on a resource resulted after the merge.
Most of the time post processors can also act as a pre processors. This gives you enough flexibility to decide when exactly do you want a processor to be applied on the resource (before or after merging).
Any processor can be used as both: pre processor or post processor. In the future, both types of processors will have the same interface and there will be no distinction in its implementation.
wro4j-core module processors
| Alias | Class name | Description |
| cssUrlRewriting | CssUrlRewritingProcessor | Rewrites background images url of the provided css content. Applied only on css resources. |
| cssImport | CssImportPreProcessor | responsible for handling css @import statements. This should be used as a pre processor and will be applied only on resources of type CSS. As a result of processing, import statements will be removed and the processed css file will contain a merged content of all imports. |
| cssVariables | CssVariablesProcessor | Performs variable replacement. For more details see CssVariablesSupport. |
| cssCompressor | CssCompressorProcessor | A css compressor, implemented by Andy Roberts. |
| semicolonAppender | SemicolonAppenderPreProcessor | Adds a semicolon (';') character to the end of each js file if it is missing, in order to avoid any problems after js resources are merged. |
| cssDataUri | CssDataUriPreProcessor | Rewrites background images by replacing the url with data uri of the image. For more details see Base64DataUriSupport |
| duplicateAwareCssDataUri | DuplicatesAwareCssDataUriPreProcessor | Similar to cssDataUri, but doesn't replace with dataUri when the same image is used more than once. |
| cssMinJawr | JawrCssMinifierProcessor | Css minimizer. The implementation is taken from jawr framework. |
| cssMin | CssMinProcessor | A simple css minimizer, which removes comments and unnecessary whitespaces. |
| jsMin | JSMinProcessor | Use JSMin utility for js compression |
| conformColors | ConformColorsCssProcessor | Transforms named colors from css to #rgb format. |
| variablizeColors | VariablizeColorsCssProcessor | Extracts all the colors used in css add details about how many times it was used. |
| - | CopyRightKeeperProcessorDecorator | A decorator for any processor. Inspects the resource for copyright (licence) header and inserts them back if the decorated processor removes them. |
| - | PlaceholderProcessor | parse a resource and search for placeholders of this type: ${} and replace them with the values found in a map provided the by client. |
| - | ExtensionsAwareProcessorDecorator | Decorates any processor with ability to process only resources of a certain extension. |
wro4j-extensions module processors
| Alias | Class name | Description |
| yuiCssMin | YUICssCompressorProcessor | Use YUI css compression utility for processing a css resource. |
| yuiJsMin | YUIJsCompressorProcessor | Use YUI js compression utility for processing js resources. |
| yuiJsMinAdvanced | YUIJsCompressorProcessor | Same as yuiJsMin but applies variable rename for better compression. |
| dojoShrinksafe | DojoShrinksafeCompressorProcessor | Compresses javascript code using compressor implemented by Dojo Shrinksafe utility |
| uglifyJs | UglifyJsProcessor | Compress js using uglifyJs utility. |
| beautifyJs | UglifyJsProcessor | Does exactly the opposite of uglifyJs. |
| packerJs | PackerJsProcessor | Uses Dean Edwards packer utility to pack js resources. |
| lessCss | LessCssProcessor | Transforms less css code into vanilla css. |
| sassCss | SassCssProcessor | Transforms sass css code into vanilla css. |
| googleClosureSimple | GoogleClosureCompressorProcessor | Compress javascript code with google closure compiler using SIMPLE_OPTIMIZATIONS |
| googleClosureAdvanced | GoogleClosureCompressorProcessor | Compress javascript code with google closure compiler using ADVANCED_OPTIMIZATIONS |
| coffeeScript | CoffeeScriptProcessor | Uses coffee script to compile to javascript code. |
| cjson-pack | CJsonProcessor | Compress JSON objects using CJson algorithm. |
| cjson-unpack | CJsonProcessor | Uncompress JSON objects previously compressed with CJson algorithm. |
| jsonh-pack | JsonHPackProcessor | Compress JSON objects using HPack algorithm. |
| jsonh-unpack | JsonHPackProcessor | Uncompress JSON objects previously compressed with HPack algorithm. |
| jsHint | JsHintProcessor | Does the static analysis of the javascript code using jsHint code quality tool. |
| jsLint | JsLintProcessor | Does the static analysis of the javascript code using jsLint code quality tool. Available since 1.4.2 release. |
| cssLint | CssLintProcessor | Does the static analysis of the css code using cssLint code quality tool. |
| DustJs | DustJsProcessor | Uses DustJs engine to compile a template into javascript. |