Skip to content

Service Worker Without PWA Example #872

@nrakochy

Description

@nrakochy

Hi there,

thanks for the great library. Are these Service Worker without PWA capabilities instructions still valid?

I created a new Vite app with react-ts@latest template, and copy-paste the linked config into the Vite config, but can't seem to get the service worker to respond with npm run dev.

I can see that the custom vite-plugin-pwa: event is firing and kicks off some mode checks (if "inline", etc), but I don't see the actual script being registered.

The only change I made from the example

self.addEventListener("fetch", (event) => {
  console.info("***** Handle fetch");
  event.respondWith(fetch(event.request));
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions