Skip to content

Commit

Permalink
fix: make server type less restrictive (fix #17627) (#17628)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilefokkema authored Jul 16, 2024
1 parent 1d0d9ab commit b55c32f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/vite/src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export type {
ServerHook,
ResolvedServerOptions,
ResolvedServerUrls,
HttpServer,
} from './server'
export type {
BuildOptions,
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/node/server/hmr.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import fsp from 'node:fs/promises'
import path from 'node:path'
import type { Server } from 'node:http'
import { EventEmitter } from 'node:events'
import colors from 'picocolors'
import type { CustomPayload, HMRPayload, Update } from 'types/hmrPayload'
Expand All @@ -14,6 +13,7 @@ import { isExplicitImportRequired } from '../plugins/importAnalysis'
import { getEnvFilesForMode } from '../env'
import { withTrailingSlash, wrapId } from '../../shared/utils'
import type { ModuleNode } from './moduleGraph'
import type { HttpServer } from '.'
import { restartServerWithUrls } from '.'

export const debugHmr = createDebugger('vite:hmr')
Expand All @@ -30,7 +30,7 @@ export interface HmrOptions {
path?: string
timeout?: number
overlay?: boolean
server?: Server
server?: HttpServer
/** @internal */
channels?: HMRChannel[]
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export interface ServerOptions extends CommonServerOptions {
*
* This is needed to proxy WebSocket connections to the parent server.
*/
server: http.Server
server: HttpServer
}
/**
* Options for files served via '/\@fs/'.
Expand Down

0 comments on commit b55c32f

Please sign in to comment.