Extend service-worker or Workbox docs?

I just created a PWA where I need to sync database(s) in the background (which would be done using a service-worker, I guess…)

How would I add a dedicated service-worker to my project?
How can I extend the built-in service-worker?

Any examples or docs?

You can just pass an array to serviceWorker.path:

serviceWorker: {
  path: ['/service-worker.js', '/another-worker.js'],

Just write your code in existing sw file

Workbox docs are here https://developers.google.com/web/tools/workbox

1 Like

Thx - I didn’t try the array in path :upside_down_face: