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

后端 未结 14 647
执念已碎
执念已碎 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:30

    You can use the following bash one-liner to compile and all less files in a directory and its subdirectories into a single css file "combined.css":

    $ find less_directory/ -name '*.less' -exec lessc {} \; > combined.css
    

    Or minified for production:

    $ find less_directory/ -name '*.less' -exec lessc -x {} \; > combined.css
    

提交回复
热议问题