ionic-team / ionic-team/ionic-docs

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

Đang mở Phù hợp với người mới
#4,702 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
content package: angular
Ngôn ngữ chính
MDX
Star
621
Fork
3.2k
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
86

Mô tả

### 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 `` 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Open the Angular PWA guide at https://ionicframework.com/docs/angular/pwa and review the setup instructions, especially the ng add step and the ngsw-config.json sample. Document the angular.json assets entry with { "glob": "**/*", "input": "public" } and refresh the sample for Angular 18+; done means the guide covers the generated public files and web-root manifest behavior.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular
Lĩnh vực
documentation
Loại issue
Tài liệu
Độ khó
2/5
Thời gian dự kiến
Nửa ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
78/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.