Skip to content

Commit

Permalink
fix: resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
ygj6 committed Oct 13, 2021
2 parents 60dbb6e + 6f696be commit 48e6887
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/vite/package.json
Expand Up @@ -105,7 +105,7 @@
"open": "^8.2.1",
"periscopic": "^2.0.3",
"postcss-import": "^14.0.2",
"postcss-load-config": "^3.0.0",
"postcss-load-config": "^3.1.0",
"postcss-modules": "^4.2.2",
"resolve.exports": "^1.0.2",
"rollup-plugin-license": "^2.5.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/vite/src/node/server/ws.ts
Expand Up @@ -12,6 +12,8 @@ import { Socket } from 'net'
export const HMR_HEADER = 'vite-hmr'

export interface WebSocketServer {
on: WebSocket.Server['on']
off: WebSocket.Server['off']
send(payload: HMRPayload): void
close(): Promise<void>
}
Expand Down Expand Up @@ -92,6 +94,8 @@ export function createWebSocketServer(
let bufferedError: ErrorPayload | null = null

return {
on: wss.on.bind(wss),
off: wss.off.bind(wss),
send(payload: HMRPayload) {
if (payload.type === 'error' && !wss.clients.size) {
bufferedError = payload
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 48e6887

Please sign in to comment.