Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e24f9794c5 |
@@ -30,8 +30,7 @@
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "public"
|
||||
},
|
||||
"src/sw.js"
|
||||
}
|
||||
],
|
||||
"styles": [
|
||||
"node_modules/bootstrap/dist/css/bootstrap.min.css",
|
||||
|
||||
@@ -25,6 +25,14 @@
|
||||
"/**/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|gif|otf|ttf|woff|woff2)"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "excluded-redirects",
|
||||
"installMode": "lazy",
|
||||
"updateMode": "lazy",
|
||||
"resources": {
|
||||
"urls": [ "/**" ]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -7,7 +7,9 @@ import { provideAnimationsAsync } from '@angular/platform-browser/animations/asy
|
||||
import { provideServiceWorker } from '@angular/service-worker';
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes), provideClientHydration(withEventReplay()), provideAnimationsAsync('noop'), provideServiceWorker('./sw.js', {
|
||||
providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes),
|
||||
provideClientHydration(withEventReplay()), provideAnimationsAsync('noop'),
|
||||
provideServiceWorker('ngsw-worker.js', {
|
||||
enabled: !isDevMode(),
|
||||
registrationStrategy: 'registerWhenStable:30000'
|
||||
})]
|
||||
|
||||
12
src/sw.js
12
src/sw.js
@@ -1,12 +0,0 @@
|
||||
self.addEventListener('fetch', event => {
|
||||
if (event &&
|
||||
event.request &&
|
||||
event.request.url &&
|
||||
// check if basename includes a dot, i.e. if it is not a file
|
||||
! event.request.url.split(/[\\/]/).pop().includes(".")
|
||||
) {
|
||||
event.stopImmediatePropagation();
|
||||
}
|
||||
});
|
||||
|
||||
self.importScripts('./ngsw-worker.js');
|
||||
Reference in New Issue
Block a user