From 9836ccb48c5a39c0999484f55731f53ba494be17 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sun, 7 May 2023 16:04:25 +0100 Subject: [PATCH] fix(vite-node): allow returning id not wrapped in promise (#3312) --- packages/vite-node/src/types.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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