fix: pwa start url updating

This commit is contained in:
DIYgod 2023-01-24 00:39:52 +00:00
parent 2f98220ed0
commit 16de217d1f
No known key found for this signature in database
1 changed files with 6 additions and 7 deletions

View File

@ -10,8 +10,13 @@ const cache = require("next-pwa/cache")
const withPWA = require("next-pwa")({
dest: "public",
publicExcludes: ["*"],
dynamicStartUrl: false,
runtimeCaching: [
{
urlPattern: ({ request }) => {
return request.headers.get("x-middleware-prefetch")
},
handler: "NetworkOnly",
},
{
urlPattern: ({ url }) => {
return /\/ipfs\/([^/?#]+)$/.test(url.toString())
@ -39,12 +44,6 @@ const withPWA = require("next-pwa")({
},
},
},
{
urlPattern: ({ request }) => {
return request.headers.get("x-middleware-prefetch")
},
handler: "NetworkOnly",
},
// @ts-ignore
...cache,
],