Sample.app
Framework Guides

Nuxt

Deploy a statically generated Nuxt project to Sample.app.

Nuxt can generate a fully static site using nuxi generate. This pre-renders all routes to HTML files.

Deploy

Generate static files

npx nuxi generate

This outputs to .output/public/ by default.

Deploy to Sample.app

Since .output/public/ is auto-detected, you can run:

samplex deploy

Or specify the directory explicitly:

samplex deploy ./.output/public

Use nuxi generate, not nuxi build. The build command creates a server bundle, while generate creates static files suitable for Sample.app.

Pre-rendering specific routes

By default, Nuxt crawls your app and pre-renders all discovered routes. To control which routes get pre-rendered:

nuxt.config.ts
export default defineNuxtConfig({
  nitro: {
    prerender: {
      routes: ["/", "/about", "/blog"],
    },
  },
});

Limitations

Features that require a server won't work with static generation:

  • Server API routes (server/api/)
  • Server middleware
  • Dynamic server-side rendering

On this page