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 655bb5fb9f
commit 4b3dff3274
+2 -2
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))