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",
server: {
memorySize: 2048,
environment: {
NUXT_PUBLIC_API_BASE: api.url,
},
},
});