Menu

1 / 2

Making a booking page installable: tenant-aware PWA with vite-plugin-pwa

DEV Community: vue·张义·12 days ago
#Ylrp6uSF
#devtovue#devto#dev#tenant#manifest
Long article (1141 words) — no AI summary yet.
Reading 0:00
15s threshold

A PWA is usually explained with one manifest and one service worker. That's fine until you serve many tenants from one installation — then every tenant needs its own app identity, its own icon label, its own start URL, and none of them should collide.

This post covers the parts that were not obvious: a per-tenant manifest, the id field that prevents duplicate home-screen icons, an update flow that doesn't destroy a half-filled booking form, and what should never be cached.

Setup

Vite 6 with vite-plugin-pwa , Workbox generateSW . The important setting is that the manifest is not generated at build time:

VitePWA ( { registerType : 'prompt' , manifest : false , // served by the API, per tenant workbox : { navigateFallbackDenylist : [ /^ \ / api \ //], runtimeCaching : [ ] // no API caching } } )

Enter fullscreen mode

Exit fullscreen mode

registerType: 'prompt' means a new service worker installs and then waits . It doesn't take over until the app tells it to.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.