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.js

Subpath 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 path

Explicit 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:

HostApproach
Netlify / Vercel_redirects / rewrite rule → /index.html
GitHub PagesNo 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+CDNStandard 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.