I have an anguler 6 app which has a service worker and when we deploy and then load our site, the index.html file seems to be cached by the service worker. The CSS file that is referenced in the index.html is an old hashed file, which results in index.html being returned as the CSS file and I get the error in the console "Uncaught SyntaxError: Unexpected token <" If I open chrome dev tools and check the "Bypass for network" checkbox for the service worker, then I don't get this issue. Below is my ngsw-config.json
{
"index": "/index.html",
"assetGroups": [{
"name": "MyApp",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/manifest.json",
"/*.css",
"/*.js"
]
}
}, {
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**"
]
}
}]
}