import { type BuildClientOptions, type BuildTargetOptions, type BuildTargetResult } from "./build.js"; import type { BuildManifest, BuildTarget, Bundler, ServerBuild } from "./build-plan.js"; /** Options for {@link buildClientVite} - the Bun {@link BuildClientOptions} minus Bun-plugin specifics, * plus the Vite plugin list the app injects for its transforms. */ export interface BuildClientViteOptions extends Omit { /** Vite plugins for the app's client transforms (e.g. `react()`, `vue()`). */ readonly vitePlugins?: readonly unknown[]; /** Vite project root (default: the parent of `routesDir`). Manifest keys are relative to it. */ readonly root?: string; } /** * Build the client bundle with Vite, emitting the SAME {@link BuildManifest} `buildClient` (Bun) does: * a content-hashed entry, per-route chunk lists, aggregate + per-route CSS, and copied `public/` files. * * The route→chunk and route→CSS mappings come from Vite's own `.vite/manifest.json` (`build.manifest`), * which records each entry's emitted `file` and its transitive `css` - exactly the two facts the Bun path * reconstructs from Bun's metafile. `viteLeakGuard()` runs during the build, so a client leak fails here * with the same error as the Bun build rather than shipping. */ export declare function buildClientVite(options: BuildClientViteOptions): Promise; /** Options for {@link buildServerVite} - the same surface as `buildServer` minus Bun-plugin specifics. */ export interface BuildServerViteOptions { readonly routesDir: string; readonly serverEntry: string; readonly outDir: string; readonly clientEntry: string; readonly styles?: readonly string[] | undefined; readonly routeStyles?: Readonly> | undefined; readonly resolve?: (file: string) => string; readonly manifestFile?: string; readonly vitePlugins?: readonly unknown[]; readonly conditions?: readonly string[]; readonly define?: Readonly>; readonly minify?: boolean; /** The runtime the worker targets - mirrors `buildServer`. `browser` = the edge (workerd/edge-light). */ readonly target?: "browser" | "node" | "bun"; /** Vite project root (default: the parent of `routesDir`). */ readonly root?: string; } /** * Build the SSR worker with Vite, emitting the SAME {@link ServerBuild} `buildServer` (Bun) does: a * self-contained worker bundle whose path is returned as `worker`. * * Like `buildServer`, it codegens the statically-analyzable `server-manifest` next to the entry (so no * `node:fs` route scan runs on a disk-less edge), then bundles. `ssr.noExternal` bundles the app + adapter * + `@nifrajs/*` into ONE file (the self-contained worker), while `node:` builtins stay external on the * `node`/`bun` targets that provide them. `NIFRA_SSR_BUNDLED` is defined so the web-react adapter uses the * bundled, deduped react-dom rather than re-rooting to a disk copy at runtime - the same tag `buildServer` * sets, and the reason a bundled SSR output does not hit the dual-React crash. * * The client-leak guards are deliberately NOT run here: a server bundle's `node:` imports are legitimate. */ export declare function buildServerVite(options: BuildServerViteOptions): Promise; /** * The Vite build STRATEGY - plugged into `buildTargetWith`. `plugins` arriving through the shared * orchestrator are the app's Vite plugins (the escape hatch's whole reason), cast to Vite's plugin type. */ export declare const viteBundler: Bundler; /** * Build a full deploy dir for `target` using the Vite/Rollup pipeline - the escape hatch for apps that * need a Vite-only transform in production. Identical output shape to {@link import("./build.js").buildTarget} * (same deploy dir, same server entry, same prerender + size report), because both delegate to the ONE * `buildTargetWith` orchestrator; only the two bundling steps differ. * * Pass the app's Vite plugins via `clientPlugins` / `serverPlugins` (the shared option names) - here they * are Vite plugins, not Bun plugins. */ export declare function buildTargetVite(target: BuildTarget, options: BuildTargetOptions): Promise; //# sourceMappingURL=build-vite.d.ts.map