wro4j less-compiler也编译.css文件

时间:2014-02-22 11:45:01

标签: wro4j

我正在使用wro4j 1.7.3 with less4j / lessCSS-compiler。

preProcessors=less4j,
yuiCssMin,googleClosureSimple

在我的wro.xml中,我有类似的内容:

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

编译时,我会收到错误,因为wro4j也将我的* .css文件视为* .less-文件。

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)

当使用lessCSS而不是less4j时,更好地显示错误原因:

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%);"
] 
}

更改处理器顺序无济于事:

preProcessors=yuiCssMin,googleClosureSimple
postProcessors=less4j

错误仍然存​​在。

是否有可能说wro4j,它不应该用css处理文件结尾。

1 个答案:

答案 0 :(得分:3)

谢谢Alex,

通过使用less4j.less,较少的处理器将只扫描较少的文件:

preProcessors=less4j, yuiCssMin,googleClosureSimple
#postProcessors=less4j

然而,之后我发现了错误的真正原因。 css文件中缺少结束括号。通过添加支架,一切正常!