diff --git a/packages/vite-node/src/types.ts b/packages/vite-node/src/types.ts index 57298f0ab248..251278e282a8 100644 --- a/packages/vite-node/src/types.ts +++ b/packages/vite-node/src/types.ts @@ -4,6 +4,7 @@ import type { ModuleCacheMap, ViteNodeRunner } from './client' export type Nullable = T | null | undefined export type Arrayable = T | Array +export type Awaitable = T | PromiseLike export interface DepsHandlingOptions { external?: (string | RegExp)[] @@ -41,7 +42,7 @@ export type HotContext = Omit export type FetchFunction = (id: string) => Promise -export type ResolveIdFunction = (id: string, importer?: string) => Promise +export type ResolveIdFunction = (id: string, importer?: string) => Awaitable export type CreateHotContextFunction = (runner: ViteNodeRunner, url: string) => HotContext