Deploy a Next.js SPA on AWS
You can deploy a Next.js SPA site on AWS with Thunder. The server pre-rendered pages produced by the build step will be stored in an S3 bucket and served using CloudFront CDN.
View code in StackBlitz
Configure
In next.config.mjs
file, uncomment the line that sets output: "export"
. Learn more about Next.js static exports.
Build Settings
Use the following commands in the build step settings:
That’s it! Your app will be live on your CloudFront URL as soon as the build finishes.