Skip to main content
Version: Next

Build & preview

Production build

pnpm build

Like dev, the build compiles the WASM module and the vanilla logger first, then runs vite build:

package.json
"build": "pnpm run build:wasm && pnpm run build:vanilla-logger && vite build"

The output goes to dist/. The Vite config builds three HTML entry points:

EntrySourcePurpose
mainindex.htmlThe modern EXEPERT app.
vanillavanilla.htmlA pristine legacy three.js r70 reference.
v1v1.htmlThe legacy renderer inside the modern UI shell.

The three package is split into its own chunk (manualChunks), the build targets es2022, emits source maps, and minifies with Terser. See Reference Pages for what the vanilla and v1 entries are for.

Vercel production build

Use this build command in Vercel:

bash scripts/vercel-build.sh

The script exists because the app has a Rust/WASM build step and because the public docs are served from the same production origin as the app.

It performs the deployment build in this order:

  1. Adds Rust to PATH, installs Rustup if needed, and ensures the wasm32-unknown-unknown target is available.
  2. Installs wasm-pack when the builder image does not already have it.
  3. Runs pnpm build, which produces the Vite app in dist/.
  4. Installs and builds docs-site/.
  5. Runs node scripts/copy-docs-build.mjs to copy the Docusaurus build into dist/.

scripts/copy-docs-build.mjs copies the top-level Docusaurus build entries into dist/ but deliberately skips the docs site's root index.html. That keeps the EXEPERT app homepage as the production root while still publishing routes like /docs/getting-started/introduction/, /blog/, and /assets/.

Leave VITE_DOCS_URL unset for the normal Vercel deployment. Production builds use the current origin for documentation links, so the top-nav Docs button and observability help links resolve to the deployed site instead of localhost:3000. Local app origins default those links to http://localhost:3000, which matches the Docusaurus dev server started from docs-site/.

The favicon assets used by the production app live in public/:

  • favicon.png
  • favicon-32.png
  • favicon-192.png
  • apple-touch-icon.png

The docs site uses the matching docs-site/static/img/favicon.png.

Preview

Serve the built dist/ locally:

pnpm preview

This runs vite preview --port 9001.

Server-side render (optional)

An SSR entry exists for producing a static HTML shell:

pnpm build:ssr

It runs vite build --ssr src/entry-server.ts --outDir dist/server. src/entry-server.ts returns a static shell that hydrates on the client; it is opt-in and not part of the default build.

Verifying a change

CommandChecks
pnpm typechecktsc --noEmit over the TypeScript sources.
pnpm testVitest: currently the telemetry-contract test.
cargo test --workspaceThe Rust unit tests in both crates.

See Testing & CI for details on what each suite covers.