Skip to content

Commit 9836ccb

Browse files
authoredMay 7, 2023
fix(vite-node): allow returning id not wrapped in promise (#3312)
1 parent 69d2711 commit 9836ccb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎packages/vite-node/src/types.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { ModuleCacheMap, ViteNodeRunner } from './client'
44

55
export type Nullable<T> = T | null | undefined
66
export type Arrayable<T> = T | Array<T>
7+
export type Awaitable<T> = T | PromiseLike<T>
78

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

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

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.