wro4j

wro4j less-compiler compiles .css files, too


I am using wro4j 1.7.3 with less4j/lessCSS-compiler.

preProcessors=less4j,
yuiCssMin,googleClosureSimple

In my wro.xml, I have something like:

<group name='css'>
    <css>/resources/css/base.css</css>
</group>

When compiling, I will get a error because wro4j treats my *.css-file also as a *.less-file.

Exception occured while processing: ro.isdc.wro.WroRuntimeException: 
Could not compile    less. 1 error(s) occured:
ERROR 437:1 missing EOF at '}' in stylesheet (which started at 23:1)
, class: ro.isdc.wro.WroRuntimeException,caused by:     
com.github.sommeri.less4j.Less4jException Could not compile less. 1 error(s) occured:
ERROR 437:1 missing EOF at '}' in stylesheet (which started at 23:1)

When using lessCSS, instead of less4j, the error reason is better shown:

MEZ: [ERROR] Exception occured while processing: ro.isdc.wro.WroRuntimeException: Could  
not execute the script because: 
{
"type": "Runtime",
"message": "error evaluating function `saturate`: Cannot find function toHSL in object   
[object Object].",
"filename": null,
"index": 11114.0,
"line": 754.0,
"callLine": null,
"callExtract": null,
"stack": null, 
"column": 17.0,
"extract": [
".img-saturate{ ",
"   -webkit-filter: saturate(500%);",
"   -moz-filter: saturate(500%);"
]
}, class: ro.isdc.wro.WroRuntimeException,caused by:  Could not execute the script   
because: 
{
"type": "Runtime",
"message": "error evaluating function `saturate`: Cannot find function toHSL in   
object [object Object].",
"filename": null,
"index": 11114.0,
"line": 754.0,
"callLine": null,
"callExtract": null,
"stack": null,
"column": 17.0,
"extract": [
".img-saturate{ ",
"   -webkit-filter: saturate(500%);",
"   -moz-filter: saturate(500%);"
] 
}

Changing the processor-order does not help:

preProcessors=yuiCssMin,googleClosureSimple
postProcessors=less4j

The error still exists.

Is there a possibility, to say wro4j, that it should not treat files endings with css as less.


Solution

  • Thanks Alex,

    by using less4j.less, the less-processor will only scan less-files:

    preProcessors=less4j, yuiCssMin,googleClosureSimple
    #postProcessors=less4j
    

    However, afterwards I found the real reason for the error. A ending brace was missing in the css file. By adding the brace, all works fine!