vite-plugin-sitemap
🗺 Generate a sitemap
Generated sitemaps adhere to the protocol described on sitemaps.org.
Install
npm i @axelrindle/vite-plugin-sitemap
Usage
import sitemap from '@axelrindle/vite-plugin-sitemap'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [
sitemap()
]
})
Configuration
The sitemap
function accepts an object with the following options:
pages
An array of Page
objects describing the basic structure you want your
sitemap to represent.
A Page
has the following structure:
interface Page {
file: string
route: string
priority?: number
}
output
The output directory to place the sitemap in.
Defaults to public
.
baseUrl
A base url to prefix all pages with.
TODO
- Automatic loading & processing of
react-router
route definitions
License
MIT