Skip to content

Commit

Permalink
fix(vite-node): allow returning id not wrapped in promise (#3312)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored May 7, 2023
1 parent 69d2711 commit 9836ccb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vite-node/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { ModuleCacheMap, ViteNodeRunner } from './client'

export type Nullable<T> = T | null | undefined
export type Arrayable<T> = T | Array<T>
export type Awaitable<T> = T | PromiseLike<T>

export interface DepsHandlingOptions {
external?: (string | RegExp)[]
Expand Down Expand Up @@ -41,7 +42,7 @@ export type HotContext = Omit<ViteHotContext, 'acceptDeps' | 'decline'>

export type FetchFunction = (id: string) => Promise<FetchResult>

export type ResolveIdFunction = (id: string, importer?: string) => Promise<ViteNodeResolveId | null>
export type ResolveIdFunction = (id: string, importer?: string) => Awaitable<ViteNodeResolveId | null | undefined | void>

export type CreateHotContextFunction = (runner: ViteNodeRunner, url: string) => HotContext

Expand Down

0 comments on commit 9836ccb

Please sign in to comment.