From 9ae094cafb7b4f463456ebc4a69c5acb2f38293d Mon Sep 17 00:00:00 2001 From: Yasser Lahbibi Date: Mon, 5 Aug 2024 19:08:58 +0200 Subject: [PATCH] fix(schema): use new options syntax for `vite-plugin-vue` (#28307) --- packages/schema/src/config/vite.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/schema/src/config/vite.ts b/packages/schema/src/config/vite.ts index a8da7e0cd4..7587e0700b 100644 --- a/packages/schema/src/config/vite.ts +++ b/packages/schema/src/config/vite.ts @@ -56,13 +56,21 @@ export default defineUntypedSchema({ }, }, script: { - propsDestructure: { - $resolve: async (val, get) => val ?? Boolean((await get('vue') as Record).propsDestructure), - }, hoistStatic: { $resolve: async (val, get) => val ?? (await get('vue') as Record).compilerOptions?.hoistStatic, }, }, + features: { + propsDestructure: { + $resolve: async (val, get) => { + if (val !== undefined && val !== null) { + return val + } + const vueOptions = await get('vue') as Record || {} + return Boolean(vueOptions.script?.propsDestructure ?? vueOptions.propsDestructure) + }, + }, + }, }, vueJsx: { $resolve: async (val: Record, get) => {