Open idealley opened 4 years ago
Hi @idealley,
You can use the disableServiceWorker
option to disable service worker generated from the plugin.
Thanks!
@rishabh3112 Should disableServiceWorker
unregister the service worker? Right now it looks like the service worker sticks around in clients browsers and continues showing stale cached content.
@theshanergy Assuming you have published build with service worker on production, now you are publishing without service worker. In that case we should not be doing this for every non service worker build. Other than that, we can add a new option for adding cleanup.
Thanks @rishabh3112 , I would propose adding support for a self destroying service worker, but also checking disableServiceWorker
in the gridsome.client.js clientConfig so that it doesn't attempt to register a service worker that does not exist. Currently it attempts to register options.serviceWorkerPath regardless of whether disableServiceWorker
has been set.
How could I override the service worker to do something like:
/ eslint-disable no-console /