Open serhii-bilyk-intellias opened 8 months ago
@serhii-bilyk-intellias you cannot test offline mode in dev, it is disabled: you need to build the app and use vite preview
or npx server dist
.
self.__WB_MANIFEST
will have only the vite base route (/ by default: you can change it using the devOptions.navigateFallback
option): check https://vite-pwa-org.netlify.app/guide/development.html#injectmanifest-strategy
The code can be found in dev vite plugin: https://github.com/vite-pwa/vite-plugin-pwa/blob/main/src/plugins/dev.ts#L121-L134
This is my VitePWA config:
This is my custom service-worker:
My goal is to make application work when offline. However, I don;t know how I can test it. When I run
npm run dev
and turn off network - I see nothing. I mean nothing is chached.Could you please point me in vite docs which minimum code I need to use to be able to debug service workers. How I can to trigger some events from service workers from my app ?
stackoverflow question