UNPKG

histoire

Version:

A fast story book powered by Vite

45 lines • 1.91 kB
import type { InlineConfig, Plugin as VitePlugin } from 'vite'; import type { Context } from '../context.js'; import { debugVitestBrowser } from '../util/browser-debug.js'; export { assignVitestBrowserProjectOptions } from './browser-project.js'; export { createVitestBrowserResolvePlugin } from './resolve-plugin.js'; /** Logs a browser-runtime lifecycle step (see {@link debugVitestBrowser}). */ export declare const debugVitestBrowserLifecycle: typeof debugVitestBrowser; /** * The Vitest + Vite config pair a browser runtime run is created from. * Exported so the collection/test config builders can be declared. */ export interface VitestBrowserRuntimeConfigResult { vitestOptions: { plugins: VitePlugin[]; }; /** Options injected only into Vitest 4's separate browser server. */ browserProjectOptions?: { plugins: VitePlugin[]; }; viteConfig: InlineConfig & { test: Record<string, any>; }; } export interface CreateVitestBrowserRuntimeConfigOptions { /** Entry scanning discovers actual browser imports instead of every development tool. */ reachableDependencies?: boolean; isServer?: boolean; define?: Record<string, string>; optimizeDeps?: { entries?: string[]; include?: string[]; noDiscovery?: boolean; force?: boolean; }; test?: Record<string, any>; } /** * Assembles the Vite + Vitest config of a Histoire browser run (story * collection or test execution) from a base Vite config. * @param ctx The histoire context. * @param viteConfig The base Vite config to extend. * @param options Per-run overrides (defines, optimizer entries, aliases…). */ export declare function createVitestBrowserRuntimeConfig(ctx: Context, viteConfig: InlineConfig, options?: CreateVitestBrowserRuntimeConfigOptions): Promise<VitestBrowserRuntimeConfigResult>; //# sourceMappingURL=index.d.ts.map