nuxt-community / pwa-template

PWA template for vue-cli based on the starter template
MIT License
133 stars 12 forks source link

How to add custom code to ServiceWorker #5

Closed buhrmi closed 7 years ago

buhrmi commented 7 years ago

I can't find a way to add custom code (eg push notifications, etc.) to the service worker when using the pwa (workbox) nuxt module. Is there a way?

This question is available on Nuxt.js community (#c4)
pi0 commented 7 years ago

Hey. Last time I've checked workbox web pack plugin there was no easy way unless writing a custom sw.js template. But try to investigate more possible ways soon :)

buhrmi commented 7 years ago

How about changing the module to the workbox-build-webpack-plugin instead of the normal workbox-webpack-plugin?

buhrmi commented 7 years ago

ah, wait, it's the same ... just got confused because I saw it has a swSrc config options and workbox-webpack-plugin didn't have it

buhrmi commented 7 years ago

Closing this because my last comments don't make sense. Will open a more eloquent issue later.