A minifier for people who don't use SASS / PostCSS.
- fastest afaik (faster than csso, cssnano)
- fully spec compliant, not just a cheeky regex
- far more readable than pure minified
- after gzip/brotli only 0.5% larger than csso
const { minify } = require('fast-css-minify')
minify(`
.popover {
position: absolute;
top: 0;
left: 0 /* rtl:ignore */;
z-index: 1070;
display: block;
max-width: 276px;
font-family: var(--bs-font-sans-serif);
}
`)
// " .popover { position: absolute; top: 0; left: 0 ; z-index: 1070; display: block; max-width: 276px; font-family: var(--bs-font-sans-serif); }\n "
Note: not yet published
npm install fast-css-minify --save
# yarn add fast-css-minify
MIT