@rasenganjs/sitemap
v1.0.0-beta.1
Published
Post-build sitemap.xml generation for Rasengan.js frontend apps (RFC-0011).
Readme
Rasengan Sitemap
Automatic sitemap.xml generation for Rasengan.js frontend apps, in ssr or prerender (SSG) mode.
rasengan-sitemap runs as a separate CLI step after rasengan build, not as a Vite plugin, so it always reads the final, complete build output.
Installation
npm install -D @rasenganjs/sitemapUsage
Create a rasengan-sitemap.config.js at your project root:
import { defineSitemapConfig } from '@rasenganjs/sitemap';
export default defineSitemapConfig({
siteUrl: 'https://your-site.com', // required
changefreq: 'weekly', // optional
priority: 0.7, // optional
exclude: ['/admin/*'], // optional, glob against the route path
generateRobotsTxt: false, // optional, off by default
});Then run the CLI after your build:
rasengan build && rasengan-sitemapOr wire it into package.json:
{
"scripts": {
"build": "rasengan build && rasengan-sitemap"
}
}rasengan-sitemap writes sitemap.xml into the same directory the app actually produced: static/ for prerender: true, dist/client/ for ssr: true.
Pure SPA builds (ssr: false, prerender: false) aren't supported: no server-rendered route bundle is produced to enumerate routes from. Temporarily set ssr: true, run rasengan build, then rasengan-sitemap, the route tree is identical either way.
What Gets Excluded Automatically
- The catch-all
*/404 route. _api/routes (excluded by construction, never part of the page route tree).- Any route matching a redirect
sourceinrasengan.config.js'sredirects(). - Anything matching your own
excludeglob patterns.
Full Documentation
See the Rasengan Sitemap docs for the full API, including transform for per-route overrides.
Community
The Rasengan.js community can be found on GitHub Discussions where you can ask questions, voice ideas, and share your projects with other people.
We also have a Twitter account where you can follow us to get the latest news about Rasengan.js.
License
Rasengan.js is MIT licensed.
Authors
Here is the authors list:
- Dilane Kombou (@dilanekombou)
