Skip to content

fix(@angular/pwa): add the manifest link when the index option is an object - #34677

Open
MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:fix/pwa-object-form-index
Open

MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:fix/pwa-object-form-index

Conversation

@MeAkib

@MeAkib MeAkib commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

The application and browser builders accept the index option either as a string or as an { input, output } object. ng add @angular/pwa only collects string values when looking for index files to update, so a project using the object form gets no <link rel="manifest"> tag. The failure is silent: when the object points at a custom file such as src/app-index.html, no index file is updated at all, and the installed application never loads the web app manifest.

Collect the input path of an object-form index alongside the string form, for both the target options and each configuration.

The new spec fails without the fix: with
"index": { "input": "projects/bar/src/app-index.html", "output": "index.html" }, the schematic left app-index.html without the manifest link.

…object

The application and browser builders accept the `index` option either as a string or as
an `{ input, output }` object. `ng add @angular/pwa` only collects string values when
looking for index files to update, so a project using the object form gets no
`<link rel="manifest">` tag. The failure is silent: when the object points at a custom
file such as `src/app-index.html`, no index file is updated at all, and the installed
application never loads the web app manifest.

Collect the `input` path of an object-form `index` alongside the string form, for both
the target options and each configuration.

The new spec fails without the fix: with
`"index": { "input": "projects/bar/src/app-index.html", "output": "index.html" }`,
the schematic left `app-index.html` without the manifest link.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Angular PWA schematic to support index files specified as an object containing input and output properties, ensuring the manifest link is correctly added to the source file referenced by input. It refactors the index file collection logic into a helper function collectIndexFile and adds a corresponding unit test. There are no review comments, so I have no feedback to provide.

@alan-agius4 alan-agius4 added target: patch This PR is targeted for the next patch release action: review The PR is still awaiting reviews from at least one requested reviewer and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Nov 9, 2026
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Nov 9, 2026
@alan-agius4

Copy link
Copy Markdown
Collaborator

Thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/pwa target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants