Repository navigation
fix(@angular/build): default preloadInitial to false when serviceWorker is enabled - #34024
Conversation
There was a problem hiding this comment.
Code Review
This pull request changes the default behavior of preloadInitial to default to false when a service worker is enabled, and true otherwise. It also updates the JSON schema and adds tests to verify this behavior. The reviewer suggested simplifying the conditional logic for preloadInitial in options.ts using optional chaining and nullish coalescing to make it more idiomatic.
4907d0d to
8e4bb0e
Compare
…er is enabled When a service worker is enabled, application assets are prefetched and served from Cache Storage. Emitting `<link rel="modulepreload">` hints for initial shared chunks causes Chromium to discard them with a "cross-world service worker resource mismatch" warning on repeat visits, as well as triggering redundant network fetches. This change sets the default of `preloadInitial` to `false` when the `serviceWorker` option is enabled, while still allowing developers to explicitly override it if desired. Fixes angular#34022
…iceWorker is enabled
efac853 to
2e3adfa
Compare
|
This PR was merged into the repository. The changes were merged into the following branches:
|
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
When a service worker is enabled, application assets are prefetched and served from Cache Storage by the service worker. Emitting
<link rel="modulepreload">hints for initial shared chunks causes Chromium to discard them with a "cross-world service worker resource mismatch" warning on repeat visits, as well as triggering redundant network fetches.This change sets the default of
preloadInitialtofalsewhen theserviceWorkeroption is enabled, while still allowing developers to explicitly override it if desired.Fixes #34022