fixed sw
This commit is contained in:
1 parent
be50463157
commit
78b1058276
2 files changed
+10
-2
No files matched your search
@@ -15,7 +15,7 @@ import { createSerwistRoute } from "@serwist/turbopack";
|
||||
const revision = spawnSync("git", ["rev-parse", "HEAD"], { encoding: "utf-8" }).stdout ?? crypto.randomUUID();
|
||||
|
||||
export const { dynamic, dynamicParams, revalidate, generateStaticParams, GET } = createSerwistRoute({
|
||||
additionalPrecacheEntries: [{ url: "/~offline", revision }],
|
||||
additionalPrecacheEntries: [{ url: "/", revision }],
|
||||
swSrc: "src/app/sw.ts",
|
||||
// nextConfig,
|
||||
// If set to `false`, Serwist will attempt to use `esbuild-wasm`.
|
||||
|
||||
+9
-1
@@ -28,7 +28,15 @@ const serwist = new Serwist({
|
||||
skipWaiting: true,
|
||||
clientsClaim: true,
|
||||
navigationPreload: true,
|
||||
runtimeCaching: defaultCache,
|
||||
runtimeCaching: [
|
||||
...defaultCache,
|
||||
{
|
||||
matcher: ({ url }) => url.hostname.includes('tile.openstreetmap.org') || url.pathname.includes('/tiles/'),
|
||||
handler: new CacheFirst({
|
||||
cacheName: 'excalibur-offline-map-tiles-v1',
|
||||
}),
|
||||
},
|
||||
],
|
||||
fallbacks: {
|
||||
entries: [
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user