when using { optimize: true }, also minify the CSS (#13201)

If you don't want to minify, but you do want to optimize, then you can
use `{ optimize: { minify: false} }` instead.
This commit is contained in:
Robin Malfait 2024-03-11 18:29:21 +01:00 • committed by GitHub
parent 8123fa513a
commit b7dd979735
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,7 +7,7 @@ type PluginOptions = {
// The base directory to scan for class candidates.
base?: string
// Optimize the output CSS.
// Optimize and minify the output CSS.
optimize?: boolean | { minify?: boolean }
}
@ -45,7 +45,7 @@ function tailwindcss(opts: PluginOptions = {}): AcceptedPlugin {
let output = css
if (optimize) {
output = optimizeCss(output, {
minify: typeof optimize === 'object' ? optimize.minify : false,
minify: typeof optimize === 'object' ? optimize.minify : true,
})
}
root.append(postcss.parse(output, result.opts))