Production Guide
How to ship an app that consumes VD3 UI: pin versions, import CSS once, keep JS named so it tree-shakes, and keep DOM work off the server. This is not a runbook for building these docs.
Pin versions
# Pin exact versions so visual output is reproducible
pnpm add @vanduo-oss/vd3@1.9.3
pnpm add @vanduo-oss/vd3-charts@1.2.1
pnpm add @vanduo-oss/vd3-flowchart@1.6.1Entry file
// main.ts — CSS once, plugin once, named JS imports elsewhere
import { createApp } from 'vue';
import { VanduoVue } from '@vanduo-oss/vd3';
import '@vanduo-oss/vd3/css';
import App from './App.vue';
createApp(App)
.use(VanduoVue, {
storagePrefix: 'my-app-',
themeDefaults: { PRIMARY_DARK: 'green' },
})
.mount('#app'); Mount VdToastContainer once in App.vue if you call useToast().
Production checklist
| Practice | Why |
|---|---|
| Browser and language scope | Verify your target browsers before release. The browser test projects target Chromium, Firefox and WebKit; check release QA results for the engines actually verified. This is not a guaranteed minimum-version matrix. RTL and locale-aware keyboard behavior are not currently promised. |
| Upgrade checks | Review the package changelog, update exact pins and the lockfile, then test theme contrast, keyboard navigation and overlays in your application. /css/core still includes all component styles. |
| Pin package versions | Lock @vanduo-oss/vd3, @vanduo-oss/vd3-charts, @vanduo-oss/vd3-flowchart so visual output is reproducible. |
| Import CSS once | @vanduo-oss/vd3/css is the full stylesheet. /css/core drops icon fonts only — it is not a tokens-only or per-component slice. Do not duplicate the bundle in your app CSS. |
| Named JS imports | Import the Vd* components and composables you use. VanduoVue does not register them globally, which is what lets unused JS tree-shake. |
| Prefetch theme defaults | Pass themeDefaults (and storagePrefix on shared origins) at app.use time so the first paint matches. |
| SSR guards at module/setup scope | Do not read window or document until onMounted. A typeof window check inside onMounted never runs on the server. |
| Code-split heavy widgets | Dynamic import() for routes and defineAsyncComponent for heavy canvas widgets. See Lazy loading. |
See also Lazy loading and Troubleshooting.