Tooling · physical bundling boundary
Vite in Presolve
Vite is part of Presolve’s application platform, but it is not the Presolve compiler. It bundles selected browser code, processes explicit physical entries, serves delegated assets, and transports source maps or HMR messages. It never decides what a route, component, Action, Field, capability, or resumable value means.
Why every scaffold installs Vite
The canonical project-local Vite dependency is used when the compiler has already authorized external browser code. Today that includes exact named package exports called by an admitted Action, Standard Schema validators, and imported form-submission capability exports.
A route imports a package export and uses it in a documented semantic form.
TypeScript proves the symbol and signature; Presolve proves the exact use and lifecycle.
Vite bundles only the compiler-authorized module and named export for the browser.
Presolve digest-lists the emitted registry beside the route and runtime products.
Run presolve dev and presolve build for the canonical application workflow. Running bare vite cannot compose compiler-owned route documents or recreate semantic artifacts.
No required Vite config
A normal Presolve project does not need vite.config.ts. The compiler invokes the project-local Vite installation for its admitted bundles with a closed configuration. Adding a Vite config file does not create routes, import component CSS into the document, publish assets/, or alter resume behavior.
The public adapter package
@presolve/vite is a low-level integration API for tool, host, and deployment adapter authors. It consumes an already-produced application-publication manifest and refuses to infer source semantics.
import { createPresolveVitePlugin } from "@presolve/vite";const plugin = createPresolveVitePlugin({compilerProduct,readArtifact: async path => readPublishedBytes(path),requestHost: async request => serveCompilerRoute(request),});The plugin validates publication schema version 1, contract presolve-application-publication:1, every artifact digest, and the workspace snapshot identity before it exposes anything to Vite.
Virtual compiler artifacts
Every manifest artifact can be addressed under virtual:presolve/v1/. The adapter reads caller-supplied bytes, recomputes SHA-256, and rejects a mismatch before returning module source. The virtual module is a transport view of compiler output, not an alternate source of content or identity.
virtual:presolve/v1/routes/root/runtime.jsvirtual:presolve/v1/environment.browser.jsonvirtual:presolve/v1/production-audit.jsonDevelopment transport and HMR
The canonical pnpm dev lifecycle is owned by the Presolve CLI. It watches authored inputs, rebuilds from compiler authority, refreshes the compiler-issued route manifest, hot-swaps finished global CSS, and uses a full reload when narrower semantic compatibility is not proven. Build failures preserve the last good page and publish compiler diagnostics in the browser.
The APIs below are the lower-level seam for a custom Vite host. They do not replace the canonical route server and are not required in application source.
startPresolveDevServer(options)Starts a Vite server around compiler-supplied request, artifact, diagnostic, and HMR callbacks for a custom host integration.
createPresolveHmrTransport(options)Transports compiler-classified schema-v1 updates on the presolve:hmr channel.
composeDevelopmentDiagnostics(input)Preserves TypeScript and Presolve records with stable authority labels and ordering.
requestHost(request)Lets compiler products answer documents and semantic endpoints before Vite handles delegated JS, CSS, and assets.
In a custom Vite host, CSS updates stay on Vite’s native module path and full reloads use Vite’s native message. Template, Action, computed, server-only, component-instance, and route update classes must come from the compiler; the adapter cannot classify an edit from a filename.
Explicit production entries
buildPresolveProduction() accepts one compiler-selected virtual entry and optional caller-declared physical viteEntries. An explicit entry can import CSS Modules, PostCSS/Tailwind output, fonts, SVGs, images, and other browser assets.
import { buildPresolveProduction } from "@presolve/vite";const output = await buildPresolveProduction({compilerProduct,readArtifact,entryArtifactPath: "routes/root/runtime.js",viteEntries: [{ name: "application-ui", path: "assets/ui-entry.js" }],vite: {root: process.cwd(),publicDir: "public",build: { outDir: "dist/vite-assets" }}});Physical Vite entries receive Vite filenames and hashes, not Presolve component or route identities. A custom host must consume the returned manifest and integrate the files. Merely placing a file in assets/ or adding vite.config.ts does not alter presolve build.
Production and source-map APIs
buildPresolveProduction(options)Builds one compiler artifact plus explicit physical entries and returns their exact mapping.
translatePresolveSourceMap(options)Joins a Vite physical map to compiler artifact provenance without inventing authored locations.
readPresolveProductionAudit(options)Digest-verifies and reads the passing compiler-owned production audit.
createPresolveVirtualModuleRegistry(options)Builds the immutable artifact-to-virtual-module registry.
What Vite may not own
- Route discovery, layout composition, metadata meaning, or static-export eligibility.
- Component identity, state ownership, Action admission, dependency planning, or teardown order.
- Environment public/server classification or capability authorization.
- Resume compatibility, snapshot codecs, or cold-fallback decisions.
- Artifact content, production policy, or deployment inventory reconstruction.