Navigated to /docs/cli/build-and-preview

Build and preview

Validate generated routes, server output, static pages, code splitting, and bundle budgets before deployment.

Treat build as application validation

tavo build compiles client and server bundles, discovers pages, prerenders static routes, generates route types, and prints each route's render mode and JavaScript cost.

BASH
bashnpx tavo build --report-json
  • Client assets are written to .tavo/build/client.

  • The SSR entry is written to .tavo/build/server.

  • Route types and manifests are written to .tavo/generated.

  • The normalized report is written when --report-json is enabled.

Fail when JavaScript exceeds the contract

First-load and route budgets turn the build table into a CI guard. Start with limits based on the current product, then lower them deliberately as architecture improves.

BASH
bashnpx tavo build --max-first-load-js 150kb --max-route-js 40kb

Preview the output you will deploy

Use preview after the build to test production chunking and asset paths. Use SSR preview when validating hydration, loaders, actions, headers, static caching, or server failures.

BASH
bash# Build again after changing source. Then choose one preview mode:
npx tavo preview

# Or serve request-time routes from the production build:
npx tavo preview --ssr

Stop the running preview with Ctrl+C before switching modes. Add --network to the chosen command to test on another device. Open a nested URL directly, refresh it, then reach it through a link; this checks both document requests and client navigation.