简体   繁体   中英

How do I export a minified CSS file using client-side less.js?

I have a web project I'm working on and it is using LESS to combine all the files into one CSS for me. However I obviously don't want the client side javascript to have to run in production as that is going to slow things down.

Is there a way with the client-side less.js that it can export the .less files you give it to a single CSS file, which I could then call in my live environment?

You have a couple of options for this that I know of:

  1. Use the LESS command line tool
  2. If you're on a Mac, use LESS.app

Running a watch command isn't that big of a deal, it becomes second nature quite quickly :)

Since you want a non-command line option, I'd recommend LESS.app if you're running OS X. If not, try Simpless (cross-platform) or Crunch (Adobe Air-based).

PS. They're all free!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM