From 678302640f93a499bd3ec1857d65134382104e23 Mon Sep 17 00:00:00 2001 From: Tobias Berger Date: Wed, 3 Nov 2021 14:38:46 +0100 Subject: [PATCH] Fix service worker tsconfig --- src/pwa/service-worker.ts | 6 +++--- src/pwa/tsconfig.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pwa/service-worker.ts b/src/pwa/service-worker.ts index cfc4f6d..0712469 100644 --- a/src/pwa/service-worker.ts +++ b/src/pwa/service-worker.ts @@ -5,7 +5,7 @@ const STATIC_CACHE_NAME = CACHE_NAME + "-" + CACHE_VERSION; const INITIAL_FILES_TO_CACHE = ["/", "/index.html", "/build/bundle.js", "/build/bundle.css", "/favicon.png"]; const CACHE_DENYLIST = ["/manifest.json", "/service-worker.js", "livereload.js"]; -const globalScope = self as unknown /* as WorkerGlobalScope */ as ServiceWorkerGlobalScope; +const globalScope = self as unknown as ServiceWorkerGlobalScope; globalScope.addEventListener("install", (event) => { console.debug("[ServiceWorker] Install"); @@ -18,10 +18,10 @@ globalScope.addEventListener("install", (event) => { ); }); -globalScope.addEventListener("activate", (evt) => { +globalScope.addEventListener("activate", (event) => { console.log("[ServiceWorker] Activate"); // Remove previous cached data from disk. - evt.waitUntil( + event.waitUntil( caches.keys().then((keyList) => { return Promise.all( keyList.map((key) => { diff --git a/src/pwa/tsconfig.json b/src/pwa/tsconfig.json index db1fd96..9a7fbd4 100644 --- a/src/pwa/tsconfig.json +++ b/src/pwa/tsconfig.json @@ -1,7 +1,7 @@ { - "target": "es2021", "include": ["service-worker.ts"], "compilerOptions": { + "target": "ES2021", "lib": ["WebWorker"] } }