trying to use vite-pwa for SW
This commit is contained in:
parent
eb6d029445
commit
8824049f28
6 changed files with 1499 additions and 52 deletions
|
|
@ -19,7 +19,7 @@ function getOrCreateServiceWorker() {
|
|||
if (!isSWSupported()) return
|
||||
const swType = process.env.HAS_MODULE_SERVICE_WORKER ? 'module' : 'classic'
|
||||
return navigator.serviceWorker
|
||||
.register('/sw-pleroma.js', { type: swType })
|
||||
.register(import.meta.env.MODE === 'production' ? '/sw-pleroma.js' : '/dev-sw.js?dev-sw', { type: swType })
|
||||
.catch((err) =>
|
||||
console.error('Unable to get or create a service worker.', err),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
/* eslint-env serviceworker */
|
||||
|
||||
import 'virtual:pleroma-fe/service_worker_env'
|
||||
|
||||
import { createI18n } from 'vue-i18n'
|
||||
|
||||
import { storage } from 'src/lib/storage.js'
|
||||
Loading…
Add table
Add a link
Reference in a new issue