What is css-minification-benchmark?
A comparison of CSS minification engines.
Which engines are covered?
What are the results?
Most of the time
crass comes first although
csso come close. Test the minifiers with your CSS to find what works best for you.
How can I see the results?
Clone the repository first then run
node ./bin/bench. That's it!
If you prefer to see results without cloning the repo here are the most recent ones.
How can I generate the html report?
node ./bin/bench --html > report.html
How can I test my CSS file?
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
Can I get the total size and time for my CSS files?
Copy all your files to the
data directory like before and run the benchmark with
How can I add a new minifier to the list?
- add it to
- require it in
lib/minify.jsand add it to
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)
How can I compare a subset of minifiers?
node ./bin/bench --only csso,cssnano (it's turned into
Can I get the compressed gzip size as well?
node ./bin/bench --gzip to measure the gzip size instead of the regular file size.
css-minification-benchmark is released under the MIT License.