@@ -3,6 +3,7 @@ import type * as net from 'node:net'
3
3
import { get as httpGet } from 'node:http'
4
4
import type * as http from 'node:http'
5
5
import { performance } from 'node:perf_hooks'
6
+ import type { Http2SecureServer } from 'node:http2'
6
7
import connect from 'connect'
7
8
import corsMiddleware from 'cors'
8
9
import colors from 'picocolors'
@@ -182,6 +183,8 @@ export type ServerHook = (
182
183
server : ViteDevServer ,
183
184
) => ( ( ) => void ) | void | Promise < ( ( ) => void ) | void >
184
185
186
+ export type HttpServer = http . Server | Http2SecureServer
187
+
185
188
export interface ViteDevServer extends AsyncDisposable {
186
189
/**
187
190
* The resolved vite config object
@@ -200,7 +203,7 @@ export interface ViteDevServer extends AsyncDisposable {
200
203
* native Node http server instance
201
204
* will be null in middleware mode
202
205
*/
203
- httpServer : http . Server | null
206
+ httpServer : HttpServer | null
204
207
/**
205
208
* chokidar watcher instance
206
209
* https://github.com/paulmillr/chokidar#api
@@ -797,7 +800,7 @@ async function startServer(
797
800
} )
798
801
}
799
802
800
- function createServerCloseFn ( server : http . Server | null ) {
803
+ function createServerCloseFn ( server : HttpServer | null ) {
801
804
if ( ! server ) {
802
805
return ( ) => { }
803
806
}
0 commit comments