ANT script to compile all (css) LESS files in a dir and subdirs with RHINO

前端 未结 6 638
日久生厌
日久生厌 2020-12-05 09:03

I want do compile all *.less scripts in a specific folder and it subdirs with less-rhino-1.1.3.js.

There is an example on github for d

6条回答
  •  借酒劲吻你
    2020-12-05 09:27

    If anyone else is coming to this question recently, as I did, they may find that the less-rhino-1.1.3.js file given in the other answers does not work with the latest version of Rhino (which for me, as of now, is 1.7R4 from MDN). But the 1.4.0 version does, which can be obtained from Github here. So the relevant snippet from my build.xml, using these later versions, is shown. Note that I'm only compiling a single .less file to a single .css file, so no iteration or mappers are used (but obviously you can get those from the other answers). Other tweaks I made were to provide the output file as the final arg to less instead of capturing output from the Ant forked process, and to remove the dependency on ant-contrib stuff (not needed for the simple one-file case).

    
    
    
    
    
    
        
            
                
                
                
            
        
    
    

提交回复
热议问题