fix: serviceworker doesnt intercept other urls

since i am using the same subdomain also for '/redirects', they were
being intercepted by the service worker
chrome now blocks the redirect altogether because of CORS when redirects
are not allowed (default on linux chromium)
This commit is contained in:
eneller committed 2025-03-04 23:44:50 +01:00
1 parent 5daa64d962
commit 5267eb6ab1
2 files changed
+13 -3

No files matched your search

+8
View File
@@ -25,6 +25,14 @@
"/**/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|gif|otf|ttf|woff|woff2)" "/**/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|gif|otf|ttf|woff|woff2)"
] ]
} }
},
{
"name": "excluded-redirects",
"installMode": "lazy",
"updateMode": "lazy",
"resources": {
"urls": [ "/**" ]
}
} }
] ]
} }
+5 -3
View File
@@ -7,8 +7,10 @@ import { provideAnimationsAsync } from '@angular/platform-browser/animations/asy
import { provideServiceWorker } from '@angular/service-worker'; import { provideServiceWorker } from '@angular/service-worker';
export const appConfig: ApplicationConfig = { export const appConfig: ApplicationConfig = {
providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes), provideClientHydration(withEventReplay()), provideAnimationsAsync('noop'), provideServiceWorker('ngsw-worker.js', { providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes),
enabled: !isDevMode(), provideClientHydration(withEventReplay()), provideAnimationsAsync('noop'),
registrationStrategy: 'registerWhenStable:30000' provideServiceWorker('ngsw-worker.js', {
enabled: !isDevMode(),
registrationStrategy: 'registerWhenStable:30000'
})] })]
}; };