chore: fix readme example
This commit is contained in:
parent
260eac3462
commit
14ccfd3379
1 changed files with 11 additions and 9 deletions
|
@ -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(':('),
|
||||||
|
}
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue