fix(schema): add types for vite: hooks (#5472)

This commit is contained in:
Daniel Roe 2022-06-15 12:51:58 +01:00 committed by GitHub
parent bea6cecb6e
commit 411eee3b77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -16,7 +16,8 @@
"devDependencies": { "devDependencies": {
"@types/lodash.template": "^4", "@types/lodash.template": "^4",
"@types/semver": "^7", "@types/semver": "^7",
"unbuild": "latest" "unbuild": "latest",
"vite": "^2.9.12"
}, },
"dependencies": { "dependencies": {
"c12": "^0.2.7", "c12": "^0.2.7",

View File

@ -2,6 +2,7 @@ import type { Server as HttpServer, IncomingMessage, ServerResponse } from 'node
import type { Server as HttpsServer } from 'node:https' import type { Server as HttpsServer } from 'node:https'
import type { Compiler, Configuration, Stats } from 'webpack' import type { Compiler, Configuration, Stats } from 'webpack'
import type { TSConfig } from 'pkg-types' import type { TSConfig } from 'pkg-types'
import type { InlineConfig as ViteInlineConfig, ViteDevServer } from 'vite'
import type { ModuleContainer } from './module' import type { ModuleContainer } from './module'
import type { NuxtTemplate, Nuxt, NuxtApp } from './nuxt' import type { NuxtTemplate, Nuxt, NuxtApp } from './nuxt'
import type { Preset as ImportPreset, Import } from 'unimport' import type { Preset as ImportPreset, Import } from 'unimport'
@ -183,9 +184,9 @@ export interface NuxtHooks {
'export:done': (generator: Generator, { errors }: { errors: any[] }) => HookResult 'export:done': (generator: Generator, { errors }: { errors: any[] }) => HookResult
// vite // vite
'vite:extend': (viteBuildContext: { nuxt: Nuxt, config: any }) => HookResult 'vite:extend': (viteBuildContext: { nuxt: Nuxt, config: ViteInlineConfig }) => HookResult
'vite:extendConfig': (viteInlineConfig: any, env: { isClient: boolean, isServer: boolean }) => HookResult 'vite:extendConfig': (viteInlineConfig: ViteInlineConfig, env: { isClient: boolean, isServer: boolean }) => HookResult
'vite:serverCreated': (viteServer: any, env: { isClient: boolean, isServer: boolean }) => HookResult 'vite:serverCreated': (viteServer: ViteDevServer, env: { isClient: boolean, isServer: boolean }) => HookResult
} }
export type NuxtHookName = keyof NuxtHooks export type NuxtHookName = keyof NuxtHooks

View File

@ -1663,6 +1663,7 @@ __metadata:
ufo: ^0.8.4 ufo: ^0.8.4
unbuild: latest unbuild: latest
unimport: ^0.2.9 unimport: ^0.2.9
vite: ^2.9.12
languageName: unknown languageName: unknown
linkType: soft linkType: soft