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 99d573c
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+44-1Lines changed: 44 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,7 +124,50 @@ After a successful build, the builder checks that the prerendered pages actually
124
124
125
125
## 📁 Known limitations <aname="limitations"></a>
126
126
127
-
-**Static builds only.** With `"outputMode": "server"` (or SSR without `outputMode`) the build fails, because the Angular SSR server looks up prerendered pages as `index.html`. An SSR entry that only renders at build time is fine.
127
+
-**Static builds only.**`prerenderFormat: "file"` is for static hosting. 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`.
128
+
129
+
✅ Works: static output, the `ssr` entry only renders at build time
130
+
131
+
```json
132
+
"options": {
133
+
"outputMode": "static",
134
+
"server": "src/main.server.ts",
135
+
"ssr": { "entry": "src/server.ts" },
136
+
"prerenderFormat": "file"
137
+
}
138
+
```
139
+
140
+
✅ Works: prerendering without SSR
141
+
142
+
```json
143
+
"options": {
144
+
"server": "src/main.server.ts",
145
+
"prerender": true,
146
+
"prerenderFormat": "file"
147
+
}
148
+
```
149
+
150
+
❌ Fails: a server is deployed
151
+
152
+
```json
153
+
"options": {
154
+
"outputMode": "server",
155
+
"server": "src/main.server.ts",
156
+
"ssr": { "entry": "src/server.ts" },
157
+
"prerenderFormat": "file"
158
+
}
159
+
```
160
+
161
+
❌ Fails: SSR without `outputMode` also deploys a server
162
+
163
+
```json
164
+
"options": {
165
+
"server": "src/main.server.ts",
166
+
"ssr": { "entry": "src/server.ts" },
167
+
"prerenderFormat": "file"
168
+
}
169
+
```
170
+
128
171
-**`ng test` warning.** The `@angular/build:unit-test` builder logs a warning when its `buildTarget` uses a builder other than `@angular/build:application`. Tests run normally.
0 commit comments