vite-pwa / nuxt

Zero-config PWA Plugin for Nuxt 3
https://vite-pwa-org.netlify.app/frameworks/nuxt
MIT License
437 stars 18 forks source link

Is it possible to disable the PWA/worker on certain routes? #65

Open ymansurozer opened 11 months ago

ymansurozer commented 11 months ago

I want to disable the PWA for certain routes where I do not need PWA functionality. Is that possible with this module?

userquin commented 11 months ago

https://github.com/vite-pwa/vite-plugin-pwa/issues/218#issuecomment-1024580718

ymansurozer commented 11 months ago

Thank you very much @userquin. I've tried that as the following unde pwa in my nuxt.config.ts but it did not work.

workbox: {
      navigateFallback: "/",
      navigateFallbackDenylist: [/^\/chat\/embed/],
      globPatterns: ["**/*.{js,css,html,png,svg,ico}"],
    },

So I am trying to exclude /chat/embed/** routes from the PWA. But I still see the 'install app' button on those pages (also devtools show an sw is registered on the page).

Does navigateFallbackDenylist fully exclude a page from the scope of the PWA or am I doing something wrong?

userquin commented 11 months ago

You should also exclude the html pages and their assets using globIgnores, but this would be a problem