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

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

    Here is the ideal solution.

    Step 1: Create a new .less file that contains an @import statement for each of your existing .less files.

    find less_directory/ -name '*.less' -exec echo "@import \"{}\";" \; > combined.less
    

    Step 2: Compile the combined .less file.

    lessc combined.less > compiled.css
    

提交回复
热议问题