---
title: "Nuxt Hooks"
description: "Build-time Nuxt hooks provided by @nuxtjs/sitemap."
canonical_url: "https://nuxtseo.com/docs/sitemap/api/nuxt-hooks"
last_updated: "2026-05-24T16:41:02.211Z"
---

## `'sitemap:prerender:done'`

**Type:** `(ctx: { options: ModuleRuntimeConfig, sitemaps: { name: string, readonly content: string }[] }) => void | Promise<void>`

Called after sitemap prerendering completes. Useful for modules that need to emit extra files based on the generated sitemaps.

**Context:**

- `options` - The resolved module runtime configuration
- `sitemaps` - Array of rendered sitemaps with their route name and XML content (content is lazily loaded from disk)

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  hooks: {
    'sitemap:prerender:done': async ({ sitemaps }) => {
      // Log sitemap info
      for (const sitemap of sitemaps) {
        console.log(`Sitemap ${sitemap.name}: ${sitemap.content.length} bytes`)
      }
    }
  }
})
```

<note>

This hook only runs at build time during `nuxt generate` or `nuxt build` with prerendering enabled.

</note>
