Dabolus / polymer3-webpack-starter-kit

Polymer 3 Starter Kit with Webpack
MIT License
55 stars 6 forks source link

Make the Service Worker more flexible #56

Closed Dabolus closed 6 years ago

Dabolus commented 6 years ago

Workbox is really great because it allows to easily create a service worker without writing a single line of code. But it is even more great because it can be included into your own service worker script. Instead of just generating the service worker at build time, it would be great to allow the user to write its own service worker, and then inject workbox into it at build time. In this way, files caching will still be automatic, but users will also be able to use other great SW features (e.g. Web Push)

Dabolus commented 6 years ago

Working on it, I noticed that I was using an old version of the workbox-webpack-plugin package. Since some of the APIs changed, I will completely refactor the SW part and use the latest possible version

Dabolus commented 6 years ago

Updated workbox-webpack-plugin to 3.x.x and configured it to inject Workbox in the SW file instead of creating one from scratch with #61