Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make server type less restrictive (fix #17627) #17628

Merged
merged 7 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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