How do I compile a directory full of less css files to css?

后端 未结 14 610
执念已碎
执念已碎 2020-12-12 22:09

I have a directory full of less css files. What is the best way to compile them to normal css? (for deployment)

Id like to run a command as follows:

         


        
14条回答
  •  北海茫月
    2020-12-12 22:38

    The way I compiled less files to the corresponding css files in the current folder tree:

    find ./ -name '*.less' -type f -exec lessc {} {}.css \; -exec rename -f 's/.less.css/.css/' {}.css \;
    

    For example, if you have main.less somewhere in the folder tree, you will get main.css in the same folder.

    But it requires rename command to be installed. To install it with help of Homebrew:

    brew install rename
    

提交回复
热议问题