@angular/service-worker not working when offline

后端 未结 2 1871
陌清茗
陌清茗 2020-12-19 14:03

I never got the service worker from Angular Mobile Team to work properly and at this point I guess I forgot to enable something, because it never worked since the initial re

2条回答
  •  爱一瞬间的悲伤
    2020-12-19 14:27

    With Maxim's help, I followed the same path as asking person, managed to add offline capability to the existing static web and deploy it on Firebase. The custom manifest on root folder should look like below, they will eventually be merged with autogenerated manifest:

    {
      "routing": {
        "index": "/index.html",
        "routes": {
          "/": {
            "prefix": false
          },
          "/home": {
            "prefix": false
          },
          "/work": { // any routes starting with '/work'
            "prefix": true
          }
        }
      },
      "external": {
        "urls": [
          {
            "url": "https://fonts.googleapis.com/css?family=Quicksand"
          }
        ]
      }
    }
    

提交回复
热议问题