2021年3月22日星期一

Can someone explain why the official angular documentation recommends registering a service-worker using ng add @angular/pwa

I'm attempting to add a service worker to an existing Angular 7 application. While the auxiliary benefits of using a service worker are appealing, the main goal in adding the service worker to the existing application is to make use of SwUpdate to inform anyone who uses the application when a new version has been deployed.

There doesn't seem to be much in the Angular Documentation about only making use of the '@angular/service-worker' package for those who do not need to turn an application into a full fledged PWA.

if anyone has experience adding an Angular service-worker to an existing application, my main questions are:

  1. Is there a recommended way of adding the sw without adding the extra files specifically associated with pwa's (ie. manifest.json and associated icons in the asset folder)?

  2. If the best practice is simply to add the sw using ng add @angular/pwa can anyone clearly articulate how to configure the application so that pwa functionality is disabled and an install feature is not available?

Additionally I'd benefit to hear more generally from anyone with angular sw experience and any advice they could give toward the intended functionality I'm trying to achieve.

Thanks all.

https://stackoverflow.com/questions/66756528/can-someone-explain-why-the-official-angular-documentation-recommends-registerin March 23, 2021 at 10:40AM

没有评论:

发表评论