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: bundle ws types #5340

Merged
merged 1 commit into from Oct 18, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/vite/package.json
Expand Up @@ -54,6 +54,8 @@
},
"devDependencies": {
"@ampproject/remapping": "^1.0.1",
"@babel/parser": "^7.15.8",
"@babel/types": "^7.15.6",
patak-dev marked this conversation as resolved.
Show resolved Hide resolved
"@rollup/plugin-alias": "^3.1.5",
"@rollup/plugin-commonjs": "^21.0.0",
"@rollup/plugin-dynamic-import-vars": "^1.4.0",
Expand Down
1 change: 1 addition & 0 deletions packages/vite/src/node/index.ts
Expand Up @@ -81,6 +81,7 @@ export type {
ErrorPayload
} from 'types/hmrPayload'
export type { Connect } from 'types/connect'
export type { WebSocket } from 'types/ws'
export type { HttpProxy } from 'types/http-proxy'
export type { FSWatcher, WatchOptions } from 'types/chokidar'
export type { Terser } from 'types/terser'
Expand Down
5 changes: 3 additions & 2 deletions packages/vite/src/node/server/ws.ts
Expand Up @@ -5,15 +5,16 @@ import {
ServerOptions as HttpsServerOptions
} from 'https'
import WebSocket from 'ws'
import { WebSocket as WebSocketTypes } from 'types/ws'
import { ErrorPayload, HMRPayload } from 'types/hmrPayload'
import { ResolvedConfig } from '..'
import { isObject } from '../utils'
import { Socket } from 'net'
export const HMR_HEADER = 'vite-hmr'

export interface WebSocketServer {
on: WebSocket.Server['on']
off: WebSocket.Server['off']
on: WebSocketTypes.Server['on']
off: WebSocketTypes.Server['off']
send(payload: HMRPayload): void
close(): Promise<void>
}
Expand Down