mirror of
https://github.com/tompro/sattle.git
synced 2026-08-27 07:15:59 +00:00
sattle: Quasar PWA scaffold with lnurlcash-kit protocol core
M1: Quasar 2 / Vue 3 / TS / Pinia / i18n / PWA app shell in the lnurl-wallet palette (#002222/#004444/#55ffcc, Noto Sans). Protocol layer is the external lnurlcash-kit library (git dependency on the fork until upstream merges the prepare fix / publishes to npm); keys.ts + receive.ts vendored from lnurl-wallet with the derivation domain renamed to 'sattle'. Nix dev shell, ci workflow (typecheck, vitest, pwa build).
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* This file (which will be your service worker)
|
||||
* is picked up by the build system ONLY if
|
||||
* quasar.config file > pwa > workboxMode is set to "InjectManifest"
|
||||
*/
|
||||
|
||||
import { clientsClaim } from "workbox-core";
|
||||
import { NavigationRoute, registerRoute } from "workbox-routing";
|
||||
import {
|
||||
cleanupOutdatedCaches,
|
||||
createHandlerBoundToURL,
|
||||
precacheAndRoute
|
||||
} from "workbox-precaching";
|
||||
|
||||
declare const self: ServiceWorkerGlobalScope & typeof globalThis;
|
||||
|
||||
void self.skipWaiting();
|
||||
clientsClaim();
|
||||
|
||||
// Use with precache injection
|
||||
precacheAndRoute(self.__WB_MANIFEST);
|
||||
|
||||
cleanupOutdatedCaches();
|
||||
|
||||
if (import.meta.env.QUASAR_PROD) {
|
||||
// Non-SSR/SSG fallbacks to index.html
|
||||
// Production SSR/SSG fallbacks to offline.html (except for dev)
|
||||
registerRoute(
|
||||
new NavigationRoute(
|
||||
createHandlerBoundToURL(import.meta.env.QUASAR_PWA_FALLBACK_HTML),
|
||||
{
|
||||
denylist: [
|
||||
new RegExp(import.meta.env.QUASAR_PWA_SERVICE_WORKER_REGEX),
|
||||
/workbox-(.)*\.js$/
|
||||
]
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user