chore: fix readme example

This commit is contained in:
Ayo Ayco 2024-08-18 12:48:33 +02:00
parent 260eac3462
commit 14ccfd3379

View file

@ -82,6 +82,7 @@ export default defineConfig({
integrations: [ integrations: [
serviceWorker({ serviceWorker({
path: "./src/sw.ts", path: "./src/sw.ts",
registrationHooks: {
afterRegistration: async () => { afterRegistration: async () => {
const sw = await navigator.serviceWorker.getRegistration(); const sw = await navigator.serviceWorker.getRegistration();
console.log('>>> registrered', sw) console.log('>>> registrered', sw)
@ -91,6 +92,7 @@ export default defineConfig({
active: () => console.log('active...'), active: () => console.log('active...'),
error: (error) => console.error(error), error: (error) => console.error(error),
unsupported: () => console.log(':('), unsupported: () => console.log(':('),
}
}) })
] ]
}); });