Skip to content

Nuxt

Source: src/AWS/Website/Nuxt.ts

Deploy a Nuxt application to AWS: the nitro server on a streaming Lambda Function URL, static assets (prerendered pages included) in S3, and a CloudFront distribution whose edge router serves uploaded files from S3 and forwards everything else to the server.

The build runs through @alchemy.run/frontend-frameworks/nuxt with the @alchemy.run/frontend-frameworks/nuxt/aws deploy target (nitro’s aws-lambda preset, streaming enabled) — both must be installed in your project.

Basic Nuxt App

const site = yield* AWS.Website.Nuxt("Web", {
rootDir: "./app",
});

Custom Domain

const site = yield* AWS.Website.Nuxt("Web", {
rootDir: "./app",
domain: {
name: "app.example.com",
hostedZoneId: zone.hostedZoneId,
},
});
const site = yield* AWS.Website.Nuxt("Web", {
rootDir: "./app",
memorySize: 2048,
env: {
NUXT_PUBLIC_API_BASE: api.url,
},
});

nuxt.config.ts is the primary home for Nuxt configuration — it loads natively. The nuxt prop layers deploy-time overrides on top (the highest-priority c12 layer) for values the file can’t express, like per-stage settings. The bag must be JSON-serializable — no functions, plugins, or modules — and nitro.preset stays owned by the deploy target.

const site = yield* AWS.Website.Nuxt("Web", {
rootDir: "./app",
nuxt: {
app: { baseURL: "/docs/" },
runtimeConfig: {
public: { apiBase: "https://api.example.com" },
},
},
});