A comparison of CSS minification engines.
Most of the time more-css comes first although clean-css and csso come close. Test the minifiers with your CSS to find what works best for you.
Clone the repository first then run ./bin/bench. That's it!
Note that on Windows you will need to do node ./bin/bench
If you prefer to see results without cloning the repo here are the most recent ones.
Just run ./bin/bench --html > report.html
Just copy your file to the data directory (make sure the filename ends with .css) and re-run the benchmark.
Please make sure your file does not contain any special comments (/*! ... */) since not all minifiers strip them correctly:
- clean-cssis configurable, but leaves all by default
- cssoalways leaves one
- ncssand- ycssminalways leave all
Copy all your files to the data directory like before and run the benchmark with --total.
- add it to package.jsonas adevDependency
- run npm install
- require it in lib/minify.jsand add it tominifiershash
- run npm run bench
- add it to this file in "Which engines are covered?" section above
- send a PR (if you wish to have it included)
Just run ./bin/bench --only ncss,ycssmin (it's turned into /.*(ncss|ycsmin).*/ regex)
Run ./bin/bench --gzip to measure the gzip size instead of the regular file size.
css-minification-benchmark is released under the MIT License.