fix: use build.client output directory for adapters#64
fix: use build.client output directory for adapters#64userquin merged 4 commits intovite-pwa:mainfrom
Conversation
|
what's the issue? |
|
On any configuration, all pwa-assets will be output to |
For server outputs, the `dist/client` output directory should be used and not `dist`.
1ea9c1a to
993d60e
Compare
|
Ok slightly different. The detection should be if |
|
Looks like we also have adapters in Astro ;) Can you send a new PR with an SSR minimal example (or just include it here) 🙏? EDIT: I need some time to read the Astro docs |
|
I'll add a SSR example |
|
@userquin I've pushed a SSR example. It's mostly the same code as |
commit: |
|
The example will not work when going offline, the sw requires the navigate fallback (offline support) and since we're not prerendering (SSG for at least 1 route => the offline page) any route will fail, but the example is fine. With any SSR (meta-)framework we have previous problem, I need to think the best solution for this to solve the problem in all integrations, for context:
Looks like we can prerender routes: https://github.com/withastro/astro/blob/3b10b97a4fecd1dfd959b160a07b5b8427fe40a7/packages/astro/src/types/public/integrations.ts#L26 |
|
@hugo-vrijswijk added prerendering index route and added small runtime caching to cache SSR pages (will use always NetworkFirst strategy), this way if the client navigates the application and goes offline, the cache will allow navigate precached routes (visited), otherwise error. EDIT: looks like Astro won't have solution for this since there is no runtime in the client (client router) like Nuxt or SvelteKit. |
|
@userquin can this be merged? Or does it need more changes? |
|
Yes, I'll merge and release a patch version in the afternoon, I was asking Astro people (Nate) about partial SSR support (there is no client-side runtime). Did you check the changes in the example? |
For server outputs, the
dist/clientoutput directory should be used and notdist.