From be5f6e419cb1257fca9abf77bb7d956f4dbfeb60 Mon Sep 17 00:00:00 2001 From: notangelmario Date: Tue, 11 Oct 2022 17:53:42 +0300 Subject: [PATCH] Updated service worker --- src/main.ts | 1 - tsconfig.json | 5 ++++- vite.config.ts | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 82b5b1d..76118f5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,4 @@ import monaco from "./lib/monaco"; -//@ts-ignore import { registerSW } from 'virtual:pwa-register' import { initStore } from "./lib/store"; import { initEditor } from "./lib/editor"; diff --git a/tsconfig.json b/tsconfig.json index 3d7d873..b67510d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,7 +14,10 @@ "noUnusedLocals": true, "noUnusedParameters": true, "noImplicitReturns": true, - "skipLibCheck": true + "skipLibCheck": true, + "types": [ + "vite-plugin-pwa/client" + ] }, "include": ["src"] } \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index 788e4f9..e515e53 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -12,6 +12,8 @@ export default defineConfig({ injectRegister: null, registerType: "prompt", workbox: { + skipWaiting: true, + clientsClaim: true, cleanupOutdatedCaches: true, maximumFileSizeToCacheInBytes: 30000000 }