Optional ReadonlyadapterThe deploy-target adapter. Chooses how vite build --ssr emits the
server bundle: nodeAdapter() for a Node HTTP server, ssgAdapter()
for static site generation (follow-up PR), etc.
Optional ReadonlyappPath to the user's app module. Must export:
makeApp(opts: { scripts: readonly string[]; styles: readonly string[] }): HttpRouterAppLayer: Layer<unknown, unknown, unknown>The plugin loads this module via Vite's SSR loader in dev, and bundles it as the server-side input in prod.
Optional ReadonlyclientPath to the user's client entry module. Used as the Rollup input
for the client bundle, which lands at dist/client/client.js.
Optional ReadonlyentryDeprecated — use app + client + adapter instead.
Path to the SSR/SSG entry module.
In SSR mode: exports a render(request: Request) => Promise<Response> function.
In SSG mode: exports { router, app?, document?, layers? } for static site generation.
Optional ReadonlyexcludeFile patterns to exclude from the transform.
Optional ReadonlyincludeFile patterns to apply the server-code stripping transform to. Defaults to all .ts/.tsx/.js/.jsx files.
Optional ReadonlymodeDeprecated — only honored with legacy entry config.
Build mode.
"ssr" (default) — Standard SSR with live server"ssg" — Static site generation. After vite build, runs
Platform.buildStaticSite() to pre-render all Route.static routes.
Options for the Stax Platform Vite plugin.
Two config shapes supported:
New shape — framework-owned lifecycle (recommended)
Pass
app,client, andadapter. The plugin owns both dev and prod HTTP server lifecycles. The user writessrc/app.tsexporting amakeApp({ scripts, styles })factory and optionalAppLayer.See issue #169 for the architecture.
Legacy shape — user-owned lifecycle (deprecated)
Pass
entry. Keeps the current behavior where the user writessrc/vite-entry.ts(dev) +src/server.ts(prod) and the plugin drives dev-mode SSR via arender(request)export. SSG mode (mode: "ssg") also uses this shape. Emits a deprecation warning on dev startup; will be removed in a future minor.