histoire
Version:
A fast story book powered by Vite
28 lines • 1.48 kB
TypeScript
import type { Context } from '../context.js';
/**
* Packages that must NEVER be prebundled for the browser run: Vitest and its
* expect/snapshot internals are resolved to the project's own copy by the
* resolve plugin, and optimizing them would fork that copy.
*/
export declare const VITEST_BROWSER_OPTIMIZER_EXCLUDES: string[];
/**
* Builds the `optimizeDeps.include` list: every browser dependency name plus,
* when resolvable, its installed directory (so nested entry points are
* prebundled too).
* @param ctx The histoire context.
*/
export declare function getVitestBrowserOptimizeDeps(ctx: Context): string[];
/**
* Lists the packages force-included in the browser dependency optimizer.
*
* Deliberately broad (every project dependency AND devDependency): the browser
* run disables Vite's dep discovery, so a story importing a package that was not
* pre-bundled triggers a mid-run optimizer reload that kills the browser
* connection. Node-only dependencies and Vite plugins stay excluded because
* their server graphs can reference browser-incompatible modules and exports.
* @param ctx The histoire context, used for the project root and support plugins.
*/
export declare function getVitestBrowserDependencyNames(ctx: Context): string[];
/** Framework runtimes reached through virtual modules before ordinary entry scanning. */
export declare function getVitestFrameworkDependencyNames(ctx: Context): string[];
//# sourceMappingURL=dependencies.d.ts.map