Skip to main content
01

Vite Plugin Sitemap

TypeScript-first Vite plugin for generating XML sitemaps from file-based conventions with zero runtime footprint.

TypeScriptViteSEOnpm

About

A Vite plugin that generates XML sitemaps at build time from a file-based convention. Supports async route fetching, auto-splitting for large sitemaps (50,000+ URLs), and Google extensions for images, videos, news, and hreflang. Nothing ships to the browser.

Usage

typescript
// vite.config.ts
import { defineConfig } from "vite";
import sitemap from "@pyyupsk/vite-plugin-sitemap";
 
export default defineConfig({
  plugins: [
    sitemap({
      hostname: "https://example.com",
    }),
  ],
});

Define routes in src/sitemap.ts or fetch them from an API at build time. CLI tools included for validation and preview.