2022-08-26 15:47:29 +00:00
|
|
|
import { defineUntypedSchema } from 'untyped'
|
2022-02-25 19:11:01 +00:00
|
|
|
|
2022-08-26 15:47:29 +00:00
|
|
|
export default defineUntypedSchema({
|
2022-02-25 19:11:01 +00:00
|
|
|
postcss: {
|
|
|
|
/**
|
|
|
|
* Options for configuring PostCSS plugins.
|
|
|
|
*
|
|
|
|
* https://postcss.org/
|
2023-10-30 08:57:11 +00:00
|
|
|
* @type {Record<string, any> & { autoprefixer?: any; cssnano?: any }}
|
2022-02-25 19:11:01 +00:00
|
|
|
*/
|
|
|
|
plugins: {
|
|
|
|
/**
|
|
|
|
* https://github.com/postcss/autoprefixer
|
|
|
|
*/
|
|
|
|
autoprefixer: {},
|
|
|
|
|
2023-10-30 08:57:11 +00:00
|
|
|
/**
|
|
|
|
* https://cssnano.co/docs/config-file/#configuration-options
|
|
|
|
*/
|
2022-02-25 19:11:01 +00:00
|
|
|
cssnano: {
|
2023-10-30 08:57:11 +00:00
|
|
|
$resolve: async (val, get) => {
|
|
|
|
if (val || val === false) {
|
|
|
|
return val
|
|
|
|
}
|
|
|
|
if (await get('dev')) {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
return {}
|
|
|
|
}
|
2022-02-25 19:11:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-08-26 15:47:29 +00:00
|
|
|
})
|