ReferenceStart
Edit this page

Start

Dev and Build Lifecycle for Bun React SSR Apps

See how react-bun-ssr handles Bun hot reload, generated client entries, production builds, and startup behavior across rbssr commands.

devbuildpreviewlifecycle

The framework has two major operating modes: development with Bun-driven hot reload, and production with immutable build output.

Command model

bun run dev
bun run build
bun run start

Development

bun run dev now splits work between a launcher process, a Bun hot child, and a long-lived browser bundle watch.

  • The launcher writes .rbssr/generated/dev/entry.ts and starts bun --hot.
  • The hot child keeps SSR in the framework fetch() path.
  • Generated client entries stay in .rbssr/generated/client-entries and are only regenerated when route topology changes.
  • Browser bundles are built by one long-lived bun build --watch process and served from /__rbssr/client/*.
  • Browser reloads use /__rbssr/ws instead of the old event stream.

Production build

bun run build creates dist/:

  • dist/client/ for JS, CSS, and copied public assets
  • dist/manifest.json for route asset lookup
  • dist/server/server.mjs as the production startup entry

Preview / start

bun run start loads the build manifest and starts the Bun HTTP server in production mode.

Rules

  • Dev mode is optimized around Bun hot reload and incremental browser rebuilds, not snapshot mirroring.
  • Production mode expects the build manifest and built assets to exist.
  • Production build and production start stay separate from the dev runtime.

Next step

Continue with File-Based Routing.