mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 09:02:03 +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.
|
* Options for configuring PostCSS plugins.
|
||||||
*
|
*
|
||||||
* https://postcss.org/
|
* https://postcss.org/
|
||||||
* @type {Record<string, any>}
|
* @type {Record<string, any> & { autoprefixer?: any; cssnano?: any }}
|
||||||
*/
|
*/
|
||||||
plugins: {
|
plugins: {
|
||||||
/**
|
/**
|
||||||
@ -14,14 +14,19 @@ export default defineUntypedSchema({
|
|||||||
*/
|
*/
|
||||||
autoprefixer: {},
|
autoprefixer: {},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* https://cssnano.co/docs/config-file/#configuration-options
|
||||||
|
*/
|
||||||
cssnano: {
|
cssnano: {
|
||||||
$resolve: async (val, get) => val ?? !(await get('dev') && {
|
$resolve: async (val, get) => {
|
||||||
preset: ['default', {
|
if (val || val === false) {
|
||||||
// Keep quotes in font values to prevent from HEX conversion
|
return val
|
||||||
// https://github.com/nuxt/nuxt/issues/6306
|
}
|
||||||
minifyFontValues: { removeQuotes: false }
|
if (await get('dev')) {
|
||||||
}]
|
return false
|
||||||
})
|
}
|
||||||
|
return {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user