Simple & lightweight CSS minifier
npm install --save-dev cssly
# or
pnpm add -D cssly
# or
yarn add -D cssly{
"scripts": {
"minify-css": "cssly"
}
}Create a .csslyrc.toml file in the root of your project to configure how cssly processes your CSS.
# Example .csslyrc.toml configuration
# List of CSS files to minify
input = ["styles/app.css", "styles/reset.css"]
# Directory where the minified files will be written
# Default: "dist"
outdir = "dist"
# Merge all input files into a single output file
# Default: false
onefile = false
# Name of the output file (only used when onefile = true)
# file = "out.css"
# Preserve CSS comments in the output
# Default: false
comments = false
# Preserve unnecessary whitespace for readability
# Default: false
whitespace = falsepnpm run minify-cssℹ cssly v1.0.0
ℹ Minifing 2 CSS files
ℹ dist/app.css 0 kB
ℹ dist/reset.css 0 kB
✔ Minified in 14 msThis project is licensed under the MIT License