content: Angular PWA guide is missing the angular.json step for Angular 18+

未关闭 适合新手
#4,702 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
半天
新手友好度
78/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
活跃
技术栈
angular
领域
documentation

调研方向

打开 https://ionicframework.com/docs/angular/pwa 上的 Angular PWA 指南并检查设置说明,尤其是 ng add 步骤和 ngsw-config.json 示例。记录 angular.json 中的 assets 条目,内容为 { "glob": "**/*", "input": "public" },并针对 Angular 18+ 更新示例;完成的标准是指南涵盖生成的 public 文件以及 Web 根目录 manifest 的行为。

由索引模型根据 Issue 内容生成。

描述

content package: angular
URL

https://ionicframework.com/docs/angular/pwa

Issue Description

The guide's only setup step is ng add @angular/pwa, which was accurate before Angular 18 but is no longer sufficient for a project created with ionic start.

Since Angular 18 the pwa schematic writes manifest.webmanifest and the icons to public/ and no longer adds an entry to angular.json. The Ionic starter's angular.json has no public asset glob, so those files are never copied into www/. On a host with a SPA rewrite the 404 is served as index.html and the browser reports Manifest: Line: 1, column: 1, Syntax error.

The page should tell readers to add the public glob to the assets array after running the schematic:

{ "glob": "**/*", "input": "public" }

Note there is deliberately no output key, so the files land at the web root and match the <link rel="manifest" href="manifest.webmanifest"> the schematic injects into index.html.

The ngsw-config.json sample on the page is also stale relative to what Angular 18+ generates and worth refreshing at the same time.

Reported in ionic-team/starters#1888, which covers the starter-side fix.

主要语言
MDX
星标
621
派生
3.2k
平均合并
1 天 2 小时
30 天内合并 PR
86

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ionic-team/ionic-docs 的其他 Issue

查看 ionic-team/ionic-docs 的全部 Issue

相似的 Issue

更多 Documentation Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。