jeudi 5 mars 2020

@angular/pwa service worker not working on my already existing project

I'm trying to add a service worker to my (already existing) project. but when i open it, it doesn't get the service worker.

These are the steps i followed:

  1. Running ng add @angular/pwa --project *my-project-name* to my project
  2. Running ng build --prod
  3. Running the app with http-server -p 8080 -c-1 dist/<my-project-name>

Now, the app is running, and it does get the manifest file but not the service worker:

enter image description here

manifest.webmanifest:

enter image description here

ngsw-config.json:

enter image description here

When i tried to do all of the above steps on a brand new project it did work and got the service worker. but not on my already existing project.




Aucun commentaire:

Enregistrer un commentaire