fix(pwa): 🐛 path precaching of pages (/routes/*/index.tsx)

This commit is contained in:
Julien Oculi 2024-07-18 18:16:04 +02:00
parent 32732be3b5
commit f7a0e2c77f

View file

@ -24,7 +24,8 @@ export const handler: SessionHandlers = {
for await (const route of expandGlob(routes, { root: '.' })) { for await (const route of expandGlob(routes, { root: '.' })) {
if (!route.isFile) continue if (!route.isFile) continue
//@ts-expect-error parentPath is missing from type definition //@ts-expect-error parentPath is missing from type definition
preCachedUrls.push(strip(routes, route.parentPath)) const path = route.parentPath as string
preCachedUrls.push(path.replace('routes', '').replace('\\', '/'))
} }
// Pre-cache files // Pre-cache files