mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
307da62cd9
As explained in #43679, currently the generation of the `ngsw.json` SW manifest is non-deterministic and often incorrect. Until we can update to an `@angular/service-worker` version that includes the fix from PR #43679, we temporarily work-around the issue by re-generating the `ngsw.json` manifest after `ng build` using the `ngsw-config` binary exposed by `@angular/service-worker`. NOTE: This works around the issue, because the [FileSystem][1] class used by the `ngsw-config` binary happens to be synchronous (unlike the implementation provided by the Angular CLI), thus avoiding the race conditions described in #43679. [1]: https://github.com/angular/angular/blob/c721135e370b34c840756bcfb22c8119b4c8c452/packages/service-worker/cli/filesystem.ts#L15 PR Close #43687
88 lines
2.0 KiB
JSON
88 lines
2.0 KiB
JSON
{
|
|
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
|
|
"index": "/index.html",
|
|
"assetGroups": [
|
|
{
|
|
"name": "app-shell",
|
|
"installMode": "prefetch",
|
|
"updateMode": "prefetch",
|
|
"resources": {
|
|
"files": [
|
|
"/index.html",
|
|
"/pwa-manifest.json",
|
|
"/assets/images/favicons/favicon.ico",
|
|
"/assets/js/*.js",
|
|
"/*.css",
|
|
"/*.js",
|
|
"!/ngsw-worker.js",
|
|
"!/safety-worker.js",
|
|
"!/worker-basic.min.js",
|
|
"!/*-es5*.js"
|
|
],
|
|
"urls": [
|
|
"https://fonts.googleapis.com/**",
|
|
"https://fonts.gstatic.com/s/**"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "assets-eager",
|
|
"installMode": "prefetch",
|
|
"updateMode": "prefetch",
|
|
"resources": {
|
|
"files": [
|
|
"/assets/images/**",
|
|
"/generated/images/marketing/**",
|
|
"!/assets/images/favicons/**",
|
|
"!/**/_unused/**"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "assets-lazy",
|
|
"installMode": "lazy",
|
|
"updateMode": "prefetch",
|
|
"resources": {
|
|
"files": [
|
|
"/assets/images/favicons/**",
|
|
"/generated/js/custom-elements-es5-polyfills.js",
|
|
"/*-es5*.js",
|
|
"!/**/_unused/**"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "docs-index",
|
|
"installMode": "prefetch",
|
|
"updateMode": "prefetch",
|
|
"resources": {
|
|
"files": [
|
|
"/generated/*.json",
|
|
"/generated/docs/*.json",
|
|
"/generated/docs/api/api-list.json",
|
|
"/generated/docs/app/search-data.json"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "docs-lazy",
|
|
"installMode": "lazy",
|
|
"updateMode": "lazy",
|
|
"resources": {
|
|
"files": [
|
|
"/generated/docs/**/*.json",
|
|
"/generated/images/**",
|
|
"!/**/_unused/**"
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"navigationUrls": [
|
|
"/**",
|
|
"!/**/*.*",
|
|
"!/**/*__*",
|
|
"!/**/*__*/**",
|
|
"!/**/stackblitz/{0,1}"
|
|
]
|
|
}
|