Production Best Practices Guide

vd3-docs ships as a statically pre-rendered site. A small, repeatable build and verification gate keeps deploys fast, accessible, and reproducible.

Build & preview
# vd3-docs is built with vite-ssg: pre-rendered HTML per route + hydration
pnpm build        # runs vite-ssg build → static dist/
pnpm preview      # serve the built output locally before deploying
The verification gate
pnpm vue-tsc --noEmit   # type safety
pnpm vitest run         # unit tests
pnpm build              # SSG build also catches unguarded window/document

The SSG build is also a correctness check — it renders every page on the server and surfaces any unguarded DOM access.

Production checklist
PracticeWhy
Pre-render with vite-ssgEach route ships static HTML for fast first paint + SEO, then hydrates.
Pin Vanduo package versionsLock @vanduo-oss/vd3 & @vanduo-oss/vd3-cbun so visual output is reproducible.
Ship only used CSSImport @vanduo-oss/vd3/css once; avoid duplicating base CSS in your app.
Code-split heavy routesDynamic import() keeps the initial bundle small (see Lazy loading).
Guard DOM in composablesSSR has no window; the build fails loudly if a composable forgets.
Run the full gate in CIvue-tsc + vitest + build before every deploy.

See also Lazy loading and Troubleshooting.