fix(schema): use new options syntax for `vite-plugin-vue` (#28307)

This commit is contained in:
Yasser Lahbibi 2024-08-05 19:08:58 +02:00 committed by GitHub
parent c62e210b84
commit 9ae094cafb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 3 deletions

View File

@ -56,13 +56,21 @@ export default defineUntypedSchema({
},
},
script: {
propsDestructure: {
$resolve: async (val, get) => val ?? Boolean((await get('vue') as Record<string, any>).propsDestructure),
},
hoistStatic: {
$resolve: async (val, get) => val ?? (await get('vue') as Record<string, any>).compilerOptions?.hoistStatic,
},
},
features: {
propsDestructure: {
$resolve: async (val, get) => {
if (val !== undefined && val !== null) {
return val
}
const vueOptions = await get('vue') as Record<string, any> || {}
return Boolean(vueOptions.script?.propsDestructure ?? vueOptions.propsDestructure)
},
},
},
},
vueJsx: {
$resolve: async (val: Record<string, any>, get) => {