mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(schema): correctly set default cssnano config (#23980)
This commit is contained in:
parent
410cecd93e
commit
802cf7a1e9
@ -6,7 +6,7 @@ export default defineUntypedSchema({
|
||||
* Options for configuring PostCSS plugins.
|
||||
*
|
||||
* https://postcss.org/
|
||||
* @type {Record<string, any>}
|
||||
* @type {Record<string, any> & { autoprefixer?: any; cssnano?: any }}
|
||||
*/
|
||||
plugins: {
|
||||
/**
|
||||
@ -14,14 +14,19 @@ export default defineUntypedSchema({
|
||||
*/
|
||||
autoprefixer: {},
|
||||
|
||||
/**
|
||||
* https://cssnano.co/docs/config-file/#configuration-options
|
||||
*/
|
||||
cssnano: {
|
||||
$resolve: async (val, get) => val ?? !(await get('dev') && {
|
||||
preset: ['default', {
|
||||
// Keep quotes in font values to prevent from HEX conversion
|
||||
// https://github.com/nuxt/nuxt/issues/6306
|
||||
minifyFontValues: { removeQuotes: false }
|
||||
}]
|
||||
})
|
||||
$resolve: async (val, get) => {
|
||||
if (val || val === false) {
|
||||
return val
|
||||
}
|
||||
if (await get('dev')) {
|
||||
return false
|
||||
}
|
||||
return {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user