active
Vite Plugin Sitemap
A TypeScript-first Vite plugin that generates XML sitemaps from file-based conventions, with zero runtime footprint.
TypeScript / Vite / SEO / npm· 2025
view .mdopen in claudeopen in chatgpt
A Vite plugin that generates XML sitemaps at build time from a file-based convention. It supports async route fetching. It auto-splits large sitemaps of more than 50,000 URLs. It also supports Google extensions for images, videos, news, and hreflang, which are language and region tags. Nothing ships to the browser.
Usage
// vite.config.ts
import { defineConfig } from "vite";
import sitemap from "@pyyupsk/vite-plugin-sitemap";
export default defineConfig({
plugins: [
sitemap({
hostname: "https://example.com",
}),
],
});
You define routes in src/sitemap.ts, or fetch them from an API at build time. The plugin includes CLI tools for validation and preview.
It is published as @pyyupsk/vite-plugin-sitemap on npm.