From 91a6a5e2693768933438d40ee044a3af20910118 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) => {