23 lines
661 B
TypeScript
23 lines
661 B
TypeScript
import { defaultCache } from "@serwist/next/worker";
|
|
import type { PrecacheEntry, SerwistGlobalConfig } from "serwist";
|
|
import { Serwist } from "serwist";
|
|
|
|
// App-Shell offline. Rezepte und die Einkaufsliste als Warteschlange kommen
|
|
// mit Arbeitspaket 7 und 8 dazu.
|
|
declare global {
|
|
interface WorkerGlobalScope extends SerwistGlobalConfig {
|
|
__SW_MANIFEST: (PrecacheEntry | string)[] | undefined;
|
|
}
|
|
}
|
|
declare const self: ServiceWorkerGlobalScope;
|
|
|
|
const serwist = new Serwist({
|
|
precacheEntries: self.__SW_MANIFEST,
|
|
skipWaiting: true,
|
|
clientsClaim: true,
|
|
navigationPreload: true,
|
|
runtimeCaching: defaultCache,
|
|
});
|
|
|
|
serwist.addEventListeners();
|