fix(schema): add typings for vite.vue options (#6220)

Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
This commit is contained in:
Daniel Roe 2022-07-29 11:57:45 +01:00 committed by GitHub
parent 8f65664ac0
commit 968087bcc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View File

@ -29,6 +29,7 @@ export default defineBuildConfig({
'webpack-bundle-analyzer',
'rollup-plugin-visualizer',
'vite',
'@vitejs/plugin-vue',
'mini-css-extract-plugin',
'terser-webpack-plugin',
'css-minimizer-webpack-plugin',

View File

@ -8,7 +8,7 @@ export default {
* See https://vitejs.dev/config for more information.
* Please note that not all vite options are supported in Nuxt.
*
* @type {typeof import('vite').UserConfig}
* @type {typeof import('../src/types/config').ViteConfig}
* @version 3
*/
vite: {

View File

@ -1,5 +1,7 @@
import { ConfigSchema } from '../../schema/config'
import type { ResolvedConfig } from 'c12'
import { UserConfig } from 'vite'
import { Options as VuePluginOptions } from '@vitejs/plugin-vue'
type DeepPartial<T> = T extends Function ? T : T extends Record<string, any> ? { [P in keyof T]?: DeepPartial<T[P]> } : T
@ -25,3 +27,11 @@ export interface PrivateRuntimeConfig extends RuntimeConfigNamespace { }
export interface RuntimeConfig extends PrivateRuntimeConfig, RuntimeConfigNamespace {
public: PublicRuntimeConfig
}
export interface ViteConfig extends UserConfig {
/**
* Options passed to @vitejs/plugin-vue
* @see https://github.com/vitejs/vite/tree/main/packages/plugin-vue
*/
vue?: VuePluginOptions
}