Repository navigation
fix(@schematics/angular): migrate serviceWorker: true to a config path in use-application-builder - #34564
Merged
alan-agius4 merged 2 commits intoOct 28, 2026
Conversation
…ath in use-application-builder The browser builder accepts `serviceWorker: true` without `ngswConfigPath` and falls back to `<projectRoot>/ngsw-config.json`, but the application builder only accepts a path or `false`. The migration kept `true` when `ngswConfigPath` was not set in the same options object, so the first `ng build` after migrating failed schema validation. Replace `true` with the `ngswConfigPath` of the same options, then the one in the base options, then the browser builder default.
There was a problem hiding this comment.
Code Review
This pull request updates the migration to the application builder by resolving how the serviceWorker option is handled, replacing serviceWorker: true with the actual path to the configuration file. However, the current implementation contains an issue where the else block incorrectly overwrites options['serviceWorker'] with options['ngswConfigPath'] even when the service worker is disabled (i.e., false or undefined). This would mistakenly enable the service worker across all configurations, and it is recommended to remove the else block to ensure it remains disabled when intended.
…onfig path in use-application-builder
alan-agius4
approved these changes
Oct 28, 2026
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The browser builder accepts
serviceWorker: truewithoutngswConfigPathand falls back to<projectRoot>/ngsw-config.json, but the application builder only accepts a path orfalse. The migration kepttruewhenngswConfigPathwas not set in the same options object, so the firstng buildafter migrating failed schema validation.Replace
truewith thengswConfigPathof the same options, then the one in the base options, then the browser builder default.