mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-19 01:45:53 +00:00
fix(schema): add typings for vite.vue
options (#6220)
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
This commit is contained in:
parent
8f65664ac0
commit
968087bcc5
@ -29,6 +29,7 @@ export default defineBuildConfig({
|
|||||||
'webpack-bundle-analyzer',
|
'webpack-bundle-analyzer',
|
||||||
'rollup-plugin-visualizer',
|
'rollup-plugin-visualizer',
|
||||||
'vite',
|
'vite',
|
||||||
|
'@vitejs/plugin-vue',
|
||||||
'mini-css-extract-plugin',
|
'mini-css-extract-plugin',
|
||||||
'terser-webpack-plugin',
|
'terser-webpack-plugin',
|
||||||
'css-minimizer-webpack-plugin',
|
'css-minimizer-webpack-plugin',
|
||||||
|
@ -8,7 +8,7 @@ export default {
|
|||||||
* See https://vitejs.dev/config for more information.
|
* See https://vitejs.dev/config for more information.
|
||||||
* Please note that not all vite options are supported in Nuxt.
|
* 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
|
* @version 3
|
||||||
*/
|
*/
|
||||||
vite: {
|
vite: {
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import { ConfigSchema } from '../../schema/config'
|
import { ConfigSchema } from '../../schema/config'
|
||||||
import type { ResolvedConfig } from 'c12'
|
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
|
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 {
|
export interface RuntimeConfig extends PrivateRuntimeConfig, RuntimeConfigNamespace {
|
||||||
public: PublicRuntimeConfig
|
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
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user