Blazor.PWA.MSBuild icon indicating copy to clipboard operation
Blazor.PWA.MSBuild copied to clipboard

How to extend the service worker definition for additional configuration?

Open bancroftway opened this issue 4 years ago • 2 comments

I would like to be able to extend the generated service worker with some workbox backgroundsync configuration. What would be suggested way to extend the generated service worker?

Could there be a way by which the build process can take a specified .js file and merge it into the generated file?

bancroftway avatar Jan 15 '20 17:01 bancroftway

Could there be a way by which the build process can take a specified .js file and merge it into the generated file?

Theoretically, sure.

Do you have an example of what your custom JS would look like? (I’m not very familiar with Workbox.)

chucker avatar Jan 15 '20 18:01 chucker

You can just edit the service worker to add that in. I don't have any plans to incorporate something like workbox as you could just use it on is own and I'd like to keep this simple. However, if someone felt strongly enough to add support for it, I would accept a PR.

SQL-MisterMagoo avatar Jan 16 '20 01:01 SQL-MisterMagoo