vite-pwa / vite-plugin-pwa

Zero-config PWA for Vite
https://vite-pwa-org.netlify.app/
MIT License
3.19k stars 208 forks source link

Usage with Vites Backend Integration #515

Open thomasdigby opened 1 year ago

thomasdigby commented 1 year ago

Is it possible to use this plugin when using Vite via the documented backend integration method? The Vite build works fine, it outputs the service worker and webmanifest correctly, I can manually add the call to register the service worker, but when I load it in the browser I'm getting an index.html error similar to this issue https://github.com/vite-pwa/vite-plugin-pwa/issues/120

Happy to dive in and try and resolve it locally if it is supported, I just wanted to check as there's nothing on the docs about backend integration support.

userquin commented 1 year ago

@thomasdigby offline support requires at least 1 html file, by default it is using index.html (default Vite entry point), if you don't have it in runtime, then the sw will fail when precahing (missing page).