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
[Feature?] Generate sitemap.xml files when building the app #423
Tried using https://github.com/jbaubree/vite-plugin-sitemap but it seems like it wont work out of the box for the sitemap config, we need a way for it to undestand the routes in solid
Hmm this is interesting because we support a combination of file system and runtime routes. I'm not sure if we can get that information easily at build time.
@ryansolid For non dynamic routes we could possible get it at build time, for dynamic routes I guess we could provide some kind of pre-defined to use but there isn't much it can be done?
For my current project it was quite easy to generate the sitemap.xml at build time.
My site is static only, route prerendering could work differently for other nitro presets or dynamic routes.
@ryansolid Something like this could be added to the docs or a starter template?
changed the title [-]Generate sitemap.xml files when building the app[/-][+][Feature?] Generate sitemap.xml files when building the app[/+]on Jul 26, 2026
Closing, since sitemap generation does not need to live in SolidStart itself:
SolidStart 2.x: use the prerender-crawler Vite plugin with its sitemap() integration, as brenelz mentioned above. It writes sitemap.xml from the pages the crawl actually renders, with dynamic segments expanded, and leaves out redirects and noindex pages.
SolidStart 1.x: add a sitemap.xml.ts API route that returns the XML, and list it under server.prerender.routes in app.config.ts so it is generated at build time. edelms's config and route above show the full setup.
Activity
kasvith commentedon Nov 11, 2022
Cant we use a vite plugin here?
fbritoferreira commentedon Jan 20, 2023
Tried using
https://github.com/jbaubree/vite-plugin-sitemapbut it seems like it wont work out of the box for the sitemap config, we need a way for it to undestand the routes in solidryansolid commentedon Dec 18, 2023
Hmm this is interesting because we support a combination of file system and runtime routes. I'm not sure if we can get that information easily at build time.
fbritoferreira commentedon Dec 21, 2023
@ryansolid For non dynamic routes we could possible get it at build time, for dynamic routes I guess we could provide some kind of pre-defined to use but there isn't much it can be done?
edelms commentedon Apr 23, 2024
For my current project it was quite easy to generate the sitemap.xml at build time.
My site is static only, route prerendering could work differently for other nitro presets or dynamic routes.
@ryansolid Something like this could be added to the docs or a starter template?
Relevant changes are the
prerenderconfig and thesitemap.xml.tsroute.https://github.com/edelms/spfx-x/blob/main/docs/app.config.ts
https://github.com/edelms/spfx-x/blob/main/docs/src/routes/sitemap.xml.ts
[-]Generate sitemap.xml files when building the app[/-][+][Feature?] Generate sitemap.xml files when building the app[/+]brenelz commentedon Sep 11, 2026
In Solid v2 we now can create sitemaps using our prerender-crawler plugin
https://github.com/solidjs/prerender-crawler/blob/4fcaf17a4b75249ad1df805cbf29cb02bec02226/packages/crawler/README.md?plain=1#L31
lxsmnsyc commentedon Oct 14, 2026
Closing, since sitemap generation does not need to live in SolidStart itself:
prerender-crawlerVite plugin with itssitemap()integration, as brenelz mentioned above. It writessitemap.xmlfrom the pages the crawl actually renders, with dynamic segments expanded, and leaves out redirects andnoindexpages.sitemap.xml.tsAPI route that returns the XML, and list it underserver.prerender.routesinapp.config.tsso it is generated at build time. edelms's config and route above show the full setup.