serviceWorkerSource()
The text of sw.js for a config.
function serviceWorkerSource(config: BakedConfig): string;Defined in: engine/src/pwa/vite.ts:252
Parameters
| Parameter | Type |
|---|---|
config | BakedConfig |
Returns
string
serviceWorker()
A Vite plugin that emits a service worker at the root of the build (sw.js), with the build id and the list of files to precache baked in. It runs on vite build only (apply: "build"), so a dev server never has a worker and never serves stale code.
BakedConfig
Everything the worker needs, fixed at build time.