小编ric*_*son的帖子

@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 the browser, i see that 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:

在此处输入图片说明

manifest.webmanifest:

在此处输入图片说明

ngsw-config.json:

在此处输入图片说明

When i tried to do all …

javascript browser service-worker progressive-web-apps angular

2
推荐指数
1
解决办法
1245
查看次数