DEV Community

Arnav Bansal
Arnav Bansal

Posted on

1 1

How do you customize service workers for Angular 6+? I'm making use of Firebase, and it needs a service worker.

I'm using Ionic 4/Angular 6 with Firebase.

I enabled Angular with this command

ng add @angular/pwa@v6-lts --project app

It generated ngsw-config.json, which generates a service worker in production. But how do I add code to the service worker?

I'm adding Firebase to it, to make use of Firebase Cloud Messaging.

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more