Open robthepaper opened 2 years ago
@robotpapier you should use transformManifest
callback on workbox
or injectManifest
plugin option, add routes in that callback.
I'm not familiar with SSR Apps, I only use it on SSG: vite-ssg
will execute twice the plugin, former on the vite lifecycle and later after vite-ssg
finish build.
You can also check for example the script on docs when building using vitepress
or check the sveltekit
example. On sveltekit
we have a similar porblem with the adapter configured, called after build, so we need to rebuild the pwa (when using static adapter).
@robotpapier check this issue https://github.com/antfu/vitesse/issues/159
Thanks for the hints, I'll have look!
@robotpapier how did it go?
@redbar0n Hi, I don't remember what I did with this plugin but now I use Sveltekit to pwa any pages I want using manifest files
and for the page I want to be a pwa I use
<meta name="description" content="" />
<link rel="manifest" crossorigin="use-credentials" href="manifests/my_manifest.json" />
</svelte:head>`
Hi, I am using vite-plugin-pwa with vite-plugin-ssr but it seems like the plugin generates the sw.js file with the precaching path before vite-plugin-ssr prerenders for production. Resulting in my routes present in the sw.js and are not cached.
How can tel vite-plugin-pwa to generate the sw.js file after vite-plugin-ssr prerender ?