UNPKG

@histoire/plugin-svelte

Version:

Histoire plugin for Svelte 4/5 and SvelteKit 2/3 support

32 lines (31 loc) • 1.06 kB
/** Small structural contract works with both Vite 7 and Vite 8 plugin types. */ interface KitMiddlewarePlugin { /** Final plugin name. */ name: string; /** Kit application SSR middleware. */ configureServer?: unknown; /** Kit application production preview middleware. */ configurePreviewServer?: unknown; } /** Keep Kit's aliases and virtual modules while Histoire owns HTML and middleware. */ export declare function isolateSvelteKit(): { name: string; enforce: 'post'; config: { order: 'post'; /** Kit's custom app middleware is removed; restore Histoire's SPA fallback. */ handler: (_config: unknown, environment: { command: string; }) => { appType: 'spa'; define?: { __SVELTEKIT_PAYLOAD__: string; }; }; }; /** Kit 3 moved SSR middleware from compile into setup; previews need no Kit SSR. */ configResolved(config: { readonly plugins: readonly KitMiddlewarePlugin[]; }): void; }; export {};