diff --git a/static/sw.js b/static/sw.js new file mode 100644 index 0000000..7588cdf --- /dev/null +++ b/static/sw.js @@ -0,0 +1,16 @@ +// Remove the service worker /sw.js from legacy installations +// This should then enable the new /service-worker.js to be installed + +self.addEventListener('activate', function (e) { + console.log(`Unregistering service worker`) + self.registration.unregister() + .then(function () { + return self.clients.matchAll(); + }) + .then(function (clients) { + clients.forEach(client => { + console.log(`Navigating ${client.url}`) + client.navigate(client.url) + }) + }); +}); \ No newline at end of file diff --git a/svelte.config.js b/svelte.config.js index 10e853b..088717c 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,6 +1,6 @@ import adapter from '@sveltejs/adapter-static'; -export default { +const config = { kit: { adapter: adapter({ pages: 'build', @@ -11,3 +11,5 @@ export default { }) } }; + +export default config;