Skip to content

Nuxt ​

Fjordrun detects Nuxt from the nuxt dependency and builds it in one of two ways.

Server-side rendering (default) ​

With a normal Nuxt app, the builder runs your build script (nuxt build) and starts:

bash
node .output/server/index.mjs

on $PORT (Nitro reads PORT and HOST automatically). No configuration needed.

Runtime config ​

Nuxt reads NUXT_* variables when the server starts:

ts
// nuxt.config.ts
export default defineNuxtConfig({
  runtimeConfig: {
    apiSecret: '',            // NUXT_API_SECRET
    public: { apiBase: '' },  // NUXT_PUBLIC_API_BASE
  },
})

Set them in the service's Variables. Your local .env is not used in production. If the app crashes at boot complaining about a missing value, see Troubleshooting.

Static (SSG / SPA) ​

The site is generated and served by nginx when any of these is true:

  • ssr: false in nuxt.config (single-page app: the builder runs nuxt generate, unknown routes fall back to 200.html);
  • nitro.preset is static or github-pages;
  • your build script runs nuxt generate.

The output is .output/public. Runtime config in a static site is fixed at build time, so NUXT_PUBLIC_* variables must be set before the build.

Start command ​

Leave it empty. nuxt preview and nuxi dev are ignored as start commands, because they are not production servers.

Monorepos ​

If the Nuxt app is in app/ and reads files from outside it (for example ../design/images), set the root directory to app: the whole repository is still available to the build. See Root directory.

Fjordrun is hosted in the EU (Hetzner, Nuremberg, Germany). Private beta.