How to correctly execute lessc-rhino-1.6.3.js from command line

与世无争的帅哥 提交于 2019-12-01 02:12:16

问题


I'm trying "latest and greatest" LESS version and it seems it does not work in rhino command-line version. I've done following

  1. Took latest rhino from here https://github.com/downloads/mozilla/rhino/rhino1_7R4.zip
  2. Took latest less-rhino-1.6.3.js from here https://github.com/less/less.js/tree/master/dist
  3. Running following from command line

    java -jar js.jar less-rhino-1.6.3.js text.less text.css
    or
    java -jar js.jar less-rhino-1.6.3.js lessc-rhino-1.6.3.js text.less text.css

The result is - "silently nothing". When trying to run 'previous latest version' - it runs OK without problems

java -jar js.jar less-rhino-1.5.1.js text.less text.css

Output is

Written to text.css

What I'm missing about latest less-rhino.js? I could not find any relevant help in http://lesscss.org or https://github.com/less/less.js. The later jut says "stackoverflow.com is a great place to get answers about Less."


回答1:


I just found out how to do it in a nice way. Rhino has a -f flag which makes it simple to do .

java -jar js.jar -f less-rhino-1.6.3.js lessc-rhino-1.6.3.js text.less text.css

The above snippet should do the work for you. The 1.6.2 release of Less split the cli-stuff from Less into lessc-rhino-[v].js and the actual library into less-rhino-[v].js. It seems like this is an undocumented change unfortunately.



来源:https://stackoverflow.com/questions/21961790/how-to-correctly-execute-lessc-rhino-1-6-3-js-from-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!