← ALL_POSTS

Prerendering a Nuxt 3 Site and Deploying It to Vercel

Prerendering generates HTML for your routes at build time. The browser and search engine crawlers get complete pages immediately, without waiting for JavaScript to run. It works well for portfolios, blogs and documentation, where content rarely changes between deploys.

Configure prerendering

Tell Nitro which routes to render. With crawlLinks enabled, Nitro follows internal links from the routes you list and renders those too:

export default defineNuxtConfig({
  nitro: {
    prerender: {
      crawlLinks: true,
      routes: ['/', '/sitemap.xml', '/robots.txt'],
    },
  },
})

Dynamic routes such as /blog/my-post are discovered when a prerendered page links to them, so make sure your blog index links to every post.

Verify the output

Build the site and look at the generated HTML:

npx nuxt build

Then request the page with curl and check that your content is in the response:

curl -s http://localhost:3000 | grep "<h1"

If the heading shows up, crawlers can see it too.

Deploy to Vercel

Vercel detects Nuxt automatically. Push the repository, import it in the Vercel dashboard, and the default build settings work. Add any environment variables, such as API keys for contact forms, under Project Settings → Environment Variables.

Check what Google sees

After deploying, open Google Search Console, paste a URL into URL inspection, and choose View crawled page. This shows the HTML Google actually received, so you can confirm that your content and meta tags are present.