Skip to content

Commit

Permalink
fix: import CustomEventMap from vite for vite-node (#2124)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Oct 7, 2022
1 parent d1919a0 commit 3dbbfe1
Showing 1 changed file with 3 additions and 8 deletions.
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

0 comments on commit 3dbbfe1

Please sign in to comment.