You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 712a028
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ If you want the option in Angular, please give the issue and the pull request a
51
51
52
52
- Angular 22 with the application builder (`@angular/build:application`)
53
53
-`"outputMode": "static"`
54
-
- A host that serves `foo.html` under `/foo` without a redirect (see [Hosts](#hosts))
54
+
- A host that serves `blog/my-article.html` under `/blog/my-article` without a redirect (see [Hosts](#hosts))
55
55
56
56
## 🚀 Quick Start <aname="quickstart"></a>
57
57
@@ -101,7 +101,7 @@ A route whose last segment is `index` (`/index`, `/docs/index`) fails the build
101
101
102
102
Static site generators have offered this choice for a long time. We decided to borrow the terminology from Astro: `build.format` with `'directory'` and `'file'` became `prerenderFormat` with the same values.
|`/blog` with `blog.html` next to the folder `blog/`| 200, `blog.html`|
125
125
126
126
Old addresses with a trailing slash keep working, they redirect to the address without it.
127
127
@@ -131,14 +131,14 @@ Check your host before switching.
131
131
## 🔧 How it works <aname="how-it-works"></a>
132
132
133
133
The builder calls `buildApplication` from `@angular/build` and wraps its internal `prerenderPages()` function, which returns the prerendered pages as a record of output paths.
134
-
The wrapper renames `foo/index.html` to `foo.html` before anything is written, so the service worker manifest and all later build steps see the final file names.
134
+
The wrapper renames `blog/my-article/index.html` to `blog/my-article.html` before anything is written, so the service worker manifest and all later build steps see the final file names.
135
135
136
136
`prerenderPages()` is internal API, so this package supports Angular 22 only.
137
137
After a successful build, the builder checks that the prerendered pages actually went through the wrapper, and fails otherwise.
138
138
139
139
## 📁 Known limitations <aname="limitations"></a>
140
140
141
-
-**Static builds only, by design.**`prerenderFormat: "file"` solves a problem of static hosting and makes no sense in other setups. An `ssr` entry is fine as long as `"outputMode"` is `"static"`: Angular then uses it only during `ng build` to prerender the pages, and no server is deployed. If a server is deployed, the build fails: a server needs no `.html` files, it answers `/foo` directly without redirecting to `/foo/`, and the Angular SSR server looks up prerendered pages as `index.html`.
141
+
-**Static builds only, by design.**`prerenderFormat: "file"` solves a problem of static hosting and makes no sense in other setups. An `ssr` entry is fine as long as `"outputMode"` is `"static"`: Angular then uses it only during `ng build` to prerender the pages, and no server is deployed. If a server is deployed, the build fails: a server needs no `.html` files, it answers `/blog/my-article` directly without redirecting to `/blog/my-article/`, and the Angular SSR server looks up prerendered pages as `index.html`.
142
142
143
143
✅ Works: static output, the `ssr` entry only renders at build time
0 commit comments