what the difference between manifest scope/start_url and ServiceWorkerModule.register scope?

Viewed 61

I'm touching the pwa in angular 11 . When implementing , I noticed that there are two scope defination in pwa :

  1. in manifest.webmanifest , scope and start_url to define what scope the ngsw-worker.js should handle

    { ... "scope": "./", "start_url": "./",

  2. in app.module.ts , another scope

    ServiceWorkerModule.register("ngsw-worker.js", { enabled: environment.production, scope: "./xxxxx/", registrationStrategy: "registerImmediately", })

Could anyone tell me what the difference among them ? quite confused which one to set as what.

My application is a spa but deployed at a subdomain as /xxxxx/ so, in this case , How should I set?

0 Answers
Related