Is it possible to get minified compiled CSS from LESS automatically? Every time I change something, I have to manually compress it.
I use less.js to compile LESS.
Thanks.
$ lessc styles.less -x
The compress command has been deprecated.
you'll have to use this command
$ lessc -clean-css style.less style.min.css
before use above command you've to install less-plugin-clean-css using below command
$ npm install less-plugin-clean-css -g
If you are using the Less command-line compiler, you could pass the -x
option in order to output minified CSS.
$ lessc styles.less -x
This is documented in Less doc:
To output minified CSS, simply pass the
-x
option. If you would like more involved minification, the Clean CSS is also available with the--clean-css
option.To see all the command line options run lessc without parameters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With