Skip to content

Latest commit

 

History

838 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@3ni8ma/vite-plugin-sitemap

npm version npm downloads License

A Vite plugin that automatically generates a sitemap.xml (and optional robots.txt) for your static site — zero configuration beyond your route list.

A Vite plugin that automatically generates a sitemap.xml for your static site.

Installation

npm install @3ni8ma/vite-plugin-sitemap

Usage

// vite.config.ts
import { defineConfig } from 'vite'
import sitemap from '@3ni8ma/vite-plugin-sitemap'

export default defineConfig({
  plugins: [
    sitemap({
      hostname: 'https://example.com',
      routes: [
        '/',
        '/about',
        '/projects',
        '/contact',
      ],
      changefreq: 'monthly',
      priority: 0.7,
    }),
  ],
})

Options

Option Type Default Description
hostname string required Your site's base URL
routes string[] required Array of route paths
changefreq string 'monthly' Sitemap change frequency
priority number 0.7 Page priority (0.0–1.0)
lastmod Date new Date() Last modified date
outDir string build.outDir Output directory
robotsTxt boolean true Auto-generate robots.txt
disallow string[] [] Paths to disallow in robots.txt

License

MIT

About

Vite plugin for auto-generating sitemap.xml and robots.txt on build

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages