Skip to content

HLiangPeng/vite-nuxt-auto-sitemap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vite-nuxt-auto-sitemap

Nuxt3 automatically generates sitemap file

Usage

Install

npm i vite-nuxt-auto-sitemap -D

Add it to nuxt.config.ts

// nuxt.config.ts
import autoSitemap from "vite-nuxt-auto-sitemap"

export default {
  vite: {
    plugins: process.env.NODE_ENV === 'production' ?
      viteNuxtautoSitemap({
        host: 'https://xxx.com'
      }),
    : '',
  }
};

Configuration

Current available options:

autoSitemap({
  /**
  * Required domain name
  */
  host: '' | []
  /**
  * Page directory relative to process directory
  */
  dirPath: './pages',
  /**
  * The relative to process directory path of sitemap output
  */
  sitemapOutPath: './public/sitemap.xml'
})

About

Nuxt3 automatically generates robot. txt file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published