Hosting & Pages
Everything ships as static assets — the SPA bundle plus one emitted file per worker entry. Any static host works; the only real consideration is history routing.
Build
npm run build # vite build → dist/
# worker entries become real chunks, bundled separately:
# dist/assets/ticker.worker-XXXX.jsSubpath mounts: zero config
The router derives its base from document.baseURI at construction — an app deployed to example.com/app/ automatically routes within /app/ (hrefs and navigate() carry the prefix). Pair it with a relative asset base and one build serves any mount:
vite build --base=./ # asset URLs relative — works under any pathExplicit override when needed: RouterModule.forRoot(routes, { basePath: '/app/' }). Details in Router.
History routing on static hosts
/users deep links need the server to return the app shell. Your options by host:
| Host | Approach |
|---|---|
| Netlify / Vercel | _redirects / rewrite rule → /index.html |
| GitHub Pages | No rewrites — either accept root-entry navigation (deep links 404), ship a 404.html that redirects into the app, or emit per-route index.html files via a prerender step like this site's. |
| nginx / S3+CDN | Standard SPA fallback to index.html |
Worker islands on static hosts
Islands need nothing special: the worker bundle is a static asset fetched same-origin, and the default transport (mode: 'poll') is plain postMessage — no SharedArrayBuffer, no COOP/COEP headers. The opt-in push mode's SAB doorbell is the only piece that would need cross-origin isolation, and it's off by default for exactly this reason.
This site
The docs you're reading are the worked example: docs-consumer/ prerenders one HTML file per route, demos build with --base=./ and mount inside the docs tree, and scripts/assemble-pages.mjs produces a dist-pages/ artifact deployable to any Pages-style host. .nojekyll keeps GitHub from filtering the underscore-free but hashed asset names.