@@ -3,6 +3,7 @@ import type * as net from 'node:net'
33import { get as httpGet } from 'node:http'
44import type * as http from 'node:http'
55import { performance } from 'node:perf_hooks'
6+ import type { Http2SecureServer } from 'node:http2'
67import connect from 'connect'
78import corsMiddleware from 'cors'
89import colors from 'picocolors'
@@ -182,6 +183,8 @@ export type ServerHook = (
182183 server : ViteDevServer ,
183184) => ( ( ) => void ) | void | Promise < ( ( ) => void ) | void >
184185
186+ export type HttpServer = http . Server | Http2SecureServer
187+
185188export interface ViteDevServer extends AsyncDisposable {
186189 /**
187190 * The resolved vite config object
@@ -200,7 +203,7 @@ export interface ViteDevServer extends AsyncDisposable {
200203 * native Node http server instance
201204 * will be null in middleware mode
202205 */
203- httpServer : http . Server | null
206+ httpServer : HttpServer | null
204207 /**
205208 * chokidar watcher instance
206209 * https://github.com/paulmillr/chokidar#api
@@ -797,7 +800,7 @@ async function startServer(
797800 } )
798801}
799802
800- function createServerCloseFn ( server : http . Server | null ) {
803+ function createServerCloseFn ( server : HttpServer | null ) {
801804 if ( ! server ) {
802805 return ( ) => { }
803806 }
0 commit comments