I want to extend native service worker for angular pwa. Task: change all base fetched urls (called origin in sw) It needs for mirrors - on url for all mirrors in sw. I have tried to register custom sw via copy ngsw-worker.js and extend it, but it broke config and updating mechanism for sw (because i have to disable default serviceworker flag in angular.json for exclude default ngsw-worker.js file usage).
ServiceWorkerModule.register('custom-ngsw.js', {enabled: true, registrationStrategy: 'registerImmediately'})
just pass another file and copy whole code from sw. also files can be merged via importScripts('some.js');