Repository navigation
Commit 4f2ca8e
committed
feat(@angular/build): add
The new `format` property of the `prerender` option accepts `directory` (default, unchanged
behavior) and `file`, like the `build.format` option of Astro. With `file`, routes are written
to `<route>.html` instead of `<route>/index.html`. Static hosts serve `<route>/index.html` under
`/<route>/`, so a request to `/<route>` is first redirected to the URL with a trailing slash,
which the Angular router then removes again. Hosts that serve `<route>.html` for `/<route>`
respond without that redirect.
The root route (after removing the `baseHref` option) is still written to `index.html`. Static
redirect pages follow the same layout. `prerender.format` is also considered when `outputMode`
is set, while `prerender.routesFile` and `prerender.discoverRoutes` are not.
`file` is only considered when the build does not produce a server, because the `@angular/ssr`
runtime looks up prerendered pages as `<route>/index.html`. In that case, a warning is reported
and routes are written to `<route>/index.html`.
Closes #29173prerender.format option to prerender routes as <route>.html
1 parent e023a8e commit 4f2ca8e
7 files changed
Lines changed: 527 additions & 9 deletions
File tree
- goldens/public-api/angular/build
- packages/angular/build/src
- builders/application
- tests/options
- utils/server-rendering
- tests/e2e/tests/build/server-rendering
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
| 172 | + | |
| 173 | + | |
171 | 174 | | |
172 | 175 | | |
173 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
342 | 343 | | |
343 | 344 | | |
344 | 345 | | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
345 | 360 | | |
346 | 361 | | |
347 | 362 | | |
| |||
492 | 507 | | |
493 | 508 | | |
494 | 509 | | |
| 510 | + | |
495 | 511 | | |
496 | 512 | | |
497 | 513 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
587 | 587 | | |
588 | 588 | | |
589 | 589 | | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
590 | 596 | | |
591 | 597 | | |
592 | 598 | | |
| |||
0 commit comments