LESS / CSS - minify css file

8 points
Created by:

In this short article we want to show how to compress *.css files with lessc command.

Quick solution:

lessc input_file.css --clean-css="--s1 --advanced --compatibility=ie8" > output_file.min.css

Note: read below description to know how to install lessc command.


css compression result with lessc command
css compression result with lessc command (file was compressed about 65%)

lessc instalation example

To install lessc it is necessary to do few steps:

  1. be sure that NodeJS is installed (instalation instruction for Windows is avaialble here),
  2. install less with following command:
    npm install -g less
  3. install lessc with following command:
    npm install -g less-plugin-clean-css
    + less-plugin-clean-css@1.5.1
    added 6 packages from 39 contributors in 1.858s
  4. now we can use lessc command (go back to Quick solution).


  1. less-plugin-clean-css - npm 

Web resources compression / minify (JS, CSS)

Native Advertising
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂