diff --git a/src/node/rpc.ts b/src/node/rpc.ts index f89ad0e..d1f237d 100644 --- a/src/node/rpc.ts +++ b/src/node/rpc.ts @@ -26,6 +26,11 @@ export function createServerRpc( .serverMetrics || {} }, async onModuleUpdated() {}, + + async list() { + const query = ctx.queryEnv({ vite: 'vite1', env: 'client' }) + return query.getModulesList() + }, } return rpc diff --git a/src/types.ts b/src/types.ts index 4982191..62bffc3 100644 --- a/src/types.ts +++ b/src/types.ts @@ -108,6 +108,11 @@ export interface RpcFunctions { getServerMetrics: (query: QueryEnv) => Promise resolveId: (query: QueryEnv, id: string) => Promise onModuleUpdated: () => Promise + + /** + * @deprecated Query for the default Vite instance with the default env. Deprecated. Use `getModulesList` instead. + */ + list: () => Promise } export interface QueryEnv {