GeezerVison is showing github.com — SSG/Prerendering: Allow generating foo.html instead of foo/index.html · Issue #29173 · angular/angular-cli
SSG/Prerendering: Allow generating foo.html instead of foo/index.html #29173DescriptionDescription
Angular's Prerendering puts nested routes into a subfolder with index.html:
=> Route blog/myslug becomes blog/myslug/index.html
The web server adds a trailing slash (for the folder) which is then removed by the Angular router, and it leads to an initial redirect.
Describe the solution you'd like
Some static site generators allow to create a flat structure instead with no subfolder:
=> Route blog/myslug becomes blog/myslug.html
Proposed solution:
- Output
myslug/index.html by default, it is the most compatible output that works on each and every web server
- add an option for flat output (
myslug.html) that can be used if I know my web server supports this
Context
Most cloud hosting providers allow to serve myslug.html under myslug:
Further read on trailing slash and framework/provider support: https://bjornlu.com/blog/trailing-slash-for-frameworks Reacted by Sander Elias, Danny Koppenhagen, Alan Agius, Nicolás Cámera, Ferdinand Malcher, Santosh Yadav, Wouter Bastaens, Brandon Roberts, Philipp Bauer, Sercan Yemen and 7 more ActivitySanderElias commented on Dec 18, 2024 I like the idea.
Just ensure that it is appropriately documented that only some providers support this.
Preferably, this should be done even in a way that surfaces this in the code-editor when they use this option. angular-robot commented on Dec 18, 2024
This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list.
You can find more details about the feature request process in our documentation. angular-robot commented on Jan 27, 2025
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.
Find more details about Angular's feature request process in our documentation. angular-robot commented on Feb 16, 2025
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation. angular-robot commented on Jun 23, 2025
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation. JohannesHoppe commented on Sep 25, 2026 I've opened a PR with a proposal for this: #34180. It adds a format property to the prerender option ("directory" by default, "file" for <route>.html), following Astro's build.format.
For anyone who can't wait: @angular-schule/prerender-format is a drop-in builder for Angular 22 that provides the same option until it lands in Angular (ng add @angular-schule/prerender-format). Reacted by Ferdinand Malcher added 4 commits that reference this issue on Sep 25, 2026This issue will close once commit e5d9701 is merged into the 'master' branch.e5d9701 This issue will close once commit 0da3613 is merged into the 'master' branch.0da3613 This issue will close once commit e2d2305 is merged into the 'master' branch.e2d2305 This issue will close once commit a6dd90a is merged into the 'master' branch.a6dd90a added a commit that references this issue on Oct 8, 2026This issue will close once commit 4f2ca8e is merged into the 'master' branch.4f2ca8e
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|