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 deployingThe verification gate
pnpm vue-tsc --noEmit # type safety
pnpm vitest run # unit tests
pnpm build # SSG build also catches unguarded window/documentThe SSG build is also a correctness check — it renders every page on the server and surfaces any unguarded DOM access.
Production checklist
| Practice | Why |
|---|---|
| Pre-render with vite-ssg | Each route ships static HTML for fast first paint + SEO, then hydrates. |
| Pin Vanduo package versions | Lock @vanduo-oss/vd3 & @vanduo-oss/vd3-cbun so visual output is reproducible. |
| Ship only used CSS | Import @vanduo-oss/vd3/css once; avoid duplicating base CSS in your app. |
| Code-split heavy routes | Dynamic import() keeps the initial bundle small (see Lazy loading). |
| Guard DOM in composables | SSR has no window; the build fails loudly if a composable forgets. |
| Run the full gate in CI | vue-tsc + vitest + build before every deploy. |
See also Lazy loading and Troubleshooting.