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: import CustomEventMap from vite for vite-node #2124

Merged
merged 1 commit into from Oct 7, 2022
Merged
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
11 changes: 3 additions & 8 deletions packages/vite-node/src/hmr/hmr.ts
@@ -1,5 +1,7 @@
/* eslint-disable no-console */
import type { ErrorPayload, FullReloadPayload, HMRPayload, PrunePayload, Update, UpdatePayload } from 'vite/types/hmrPayload'

import type { HMRPayload, Update } from 'vite/types/hmrPayload'
import type { CustomEventMap } from 'vite/types/customEvent'
import c from 'picocolors'
import createDebug from 'debug'
import type { ViteNodeRunner } from '../client'
Expand All @@ -8,13 +10,6 @@ import type { HMREmitter } from './emitter'

const debugHmr = createDebug('vite-node:hmr')

export interface CustomEventMap {
'vite:beforeUpdate': UpdatePayload
'vite:beforePrune': PrunePayload
'vite:beforeFullReload': FullReloadPayload
'vite:error': ErrorPayload
}

export type InferCustomEventPayload<T extends string> =
T extends keyof CustomEventMap ? CustomEventMap[T] : any

Expand Down