How to have a service worker with a runtime enabled option?
问题 I created a lib-pwa library that takes care of the service worker. Because it's a library I have to feed it the environment from the client application, and not use a local environment definition. To this end, I use the ng-environmenter dependency in the module of the library. import { Environmenter } from 'ng-environmenter'; function serviceWorkerFactory(environmenter: Environmenter): SwRegistrationOptions { const isProduction: boolean = environmenter.getGlobalEnvironment().environment