> :loudspeaker: Update In v0.43.0, you can now ...
# general
f
📢 Update
In v0.43.0, you can now deploy your Next.js app to your AWS account along with the rest of your infrastructure. Similar to the StaticSite construct, 
sst.NextjsSite
 will • build and deploy the app to an S3 bucket; • setup a CloudFront CDN for fast content delivery; • setup Lambda@Edge functions to handle routing, SSG, SSR, API routes, ISR, Image optimization, etc; • configure custom domain; • configure resources outputs as
NEXT_PUBLIC_
environment variables
Copy code
new NextjsSite(this, "NextSite", {
  path: "path/to/site",
  environment: {
    NEXT_PUBLIC_API_URL: api.url,
  },
});
Here are some more examples.
a
Epic! We're using Vercel at the moment for our NextJS deployments. How does the interaction between SEED and NextJS play out? Will we get preview urls? 🙏
s
Awesome @Frank. I am hoping this means I can completely ditch amplify and handle Auth inside lambda@edge 👍
f
@Alex Price yes yes, if you adopt the PR workflow, the deployed url for each pull request will be added as a comment on the PR page
a
Wicked! Thanks Frank and SST team 😍 😍 😍
a
Haha, SST is going to vercel a run for its money lol. 😂
f
@Simon Reilly thanks for pointing me in the right direction man! Behind the scene,
NextjsSite
is partially relying on
@serverless-nextjs/lambda-at-edge
for building the Lambda@Edge part. I’m sure you know better 😁
@Ashishkumar Pandey haha Vercel experience is pretty smooth. Invalidating CloudFront still takes too long. But I think being able to deploy into ur AWS account and interact with other resources is pretty powerful.
a
I was using Vercel since it was now, It was pretty basic then. NextJS was still almost unknown. We’re at a good place to begin with. serverless-nextjs while very helpful is quite outdated, that’s something which if improved would bring amazing gains to the overall experience as well.
f
outdated as in feature parity wise?
a
yep. it still depends on webpack 4 last I checked.
I see it recently got nextjs 10 and 11 support, in that case there’s no point in solving a solved problem.
s
I am predicting nextjs is about to get a rust based compiler, (swc) as they hired the creator/maintainer and have been converting their test suites
a
that’d be amazing, those builds would complete in a jiffy.
m
Great stuff @Frank
y
Excited to give this a try -- been fighting amplify for the last week on a newly migrated project (away from Vercel)
y
We currently use NextJS SSR and have it deployed on AWS EBS, is there any article or docs on how to do this using SST ?
y
Will try this out, I thought it was just for SSG / ISR, thanks!
y
I use all three features with success. I've got SSG / ISR needs and some API endpoints
y
Excited to try it out. Will try and give it a go tonight!
y
👍 feel free to message me if you encounter any issues