fix(pwa): make sure the service worker can be loaded (#1594)

Co-authored-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
Pieter Willekens 2023-12-01 23:18:22 +01:00 committed by GitHub
parent 82f06471cf
commit 0f695db325
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 17 deletions

View File

@ -1,15 +0,0 @@
/// <reference no-default-lib="true"/>
/// <reference lib="esnext" />
/// <reference lib="WebWorker" />
declare let self: ServiceWorkerGlobalScope
import { precacheAndRoute, cleanupOutdatedCaches } from 'workbox-precaching'
import { clientsClaim } from 'workbox-core'
// disable workbox logs
self.__wb_disable_dev_logs = true
cleanupOutdatedCaches() // cleanup everything that's not needed anymore
precacheAndRoute(self.__WB_MANIFEST) //cache our new stuff
self.skipWaiting()
clientsClaim()

View File

@ -13,8 +13,6 @@ import { VitePWA, VitePWAOptions } from 'vite-plugin-pwa'
const PWAConfig: Partial<VitePWAOptions> = {
registerType: 'autoUpdate',
srcDir: 'src',
filename: 'sw.ts',
includeAssets: ['fonts/**/*.woff2', 'img/**/*.svg', 'img/**/*.png'],
manifest: {
name: 'Mainsail',