histoire
Version:
A fast story book powered by Vite
26 lines • 1.27 kB
TypeScript
/** Output chunk surface read and rewritten by the facade pass. */
export interface FacadeOutputChunk {
/** Discriminates chunks from emitted assets. */
type: 'chunk';
/** Bundle-relative output path. */
fileName: string;
/** Rendered chunk code, rewritten in place. */
code: string;
/** True when the chunk is the target of a dynamic `import()`. */
isDynamicEntry?: boolean;
}
/** Bundle map shape shared by Rollup and Rolldown `generateBundle` hooks. */
export type FacadeOutputBundle = Record<string, FacadeOutputChunk | {
type: 'asset';
}>;
/**
* Rolldown renders a dynamically imported module that also has static importers
* as a shared chunk with mangled exports plus a re-export facade for `import()`.
* Vitest mocks in built stories intercept the facade URL, while static importers
* still bind the inner chunk and keep the original module. Route those static
* imports through the facade so every consumer shares the mockable URL; facade
* re-exports are live bindings, so module semantics stay unchanged.
* @param bundle Output bundle from `generateBundle`, rewritten in place.
*/
export declare function routeImportsThroughDynamicFacades(bundle: FacadeOutputBundle): void;
//# sourceMappingURL=mock-facades.d.ts.map