- Typescript support
- Allow to pass dynamic routes
- Sitemap cache
- Chunks splitting
- Exclude certain routes from the sitemap
Install package via a package manager:
# using npm
npm install @artmizu/sitemap-nuxt-2
# using yarm
yarn add @artmizu/sitemap-nuxt-2
# using pnpm
pnpm add @artmizu/sitemap-nuxt-2
Add it to a modules
property of your nuxt config:
export default {
modules: ['@artmizu/sitemap-nuxt-2']
}
You can pass it through module options and the nuxt config property sitemap
.
- Type:
Promise<SitemapRoute[]>
- Description: Pass a promise, which will be resolved with routes array
- Type:
number
- Default:
1000 * 60 * 60 * 24
- Type:
number
- Default:
50000
- Type:
string[]
- Default:
['/**/(*', '/**/*script']
- Type:
boolean
- Default:
false
- Type: 'object`
- Default:
{
changefreq: 'monthly',
priority: 0.1,
lastmod: new Date(),
}
- Type:
string
- Default:
path.resolve(tmpdir())
- Type:
string
- Default:
path.resolve(tmpdir(), './sitemap-routes.json')
- Type:
function
- Type:
function
- Type:
function
- Description: From the callback params you can get the sitemap generation time