fix(schema): add types for vue experimental features (#21364)

This commit is contained in:
Wilson Pinto 2023-06-05 01:06:01 +02:00 committed by GitHub
parent 5d9973da49
commit 1e6d640bf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 0 deletions

View File

@ -20,6 +20,20 @@ export default defineUntypedSchema({
runtimeCompiler: { runtimeCompiler: {
$resolve: async (val, get) => val ?? await get('experimental.runtimeVueCompiler') ?? false, $resolve: async (val, get) => val ?? await get('experimental.runtimeVueCompiler') ?? false,
}, },
/**
* Vue Experimental: Enable reactive destructure for `defineProps`
* @see [Vue RFC#502](https://github.com/vuejs/rfcs/discussions/502)
* @type {boolean}
*/
propsDestructure: false,
/**
* Vue Experimental: Enable macro `defineModel`
* @see [Vue RFC#503](https://github.com/vuejs/rfcs/discussions/503)
* @type {boolean}
*/
defineModel: false
}, },
/** /**

View File

@ -40,6 +40,14 @@ export default defineUntypedSchema({
compilerOptions: { compilerOptions: {
$resolve: async (val, get) => val ?? (await get('vue')).compilerOptions $resolve: async (val, get) => val ?? (await get('vue')).compilerOptions
} }
},
script: {
propsDestructure: {
$resolve: async (val, get) => val ?? Boolean((await get('vue')).propsDestructure),
},
defineModel: {
$resolve: async (val, get) => val ?? Boolean((await get('vue')).defineModel),
},
} }
}, },
vueJsx: { vueJsx: {

View File

@ -164,6 +164,8 @@ export default defineUntypedSchema({
embed: 'src' embed: 'src'
}, },
compilerOptions: { $resolve: async (val, get) => val ?? (await get('vue.compilerOptions')) }, compilerOptions: { $resolve: async (val, get) => val ?? (await get('vue.compilerOptions')) },
propsDestructure: { $resolve: async (val, get) => val ?? Boolean(await get('vue.propsDestructure')) },
defineModel: { $resolve: async (val, get) => val ?? Boolean(await get('vue.defineModel')) },
}, },
css: { css: {
importLoaders: 0, importLoaders: 0,