Now, we did talk a lot about deployment
and it matters,
and we did talk a lot about this standard build
with next build.
And that works and is the standard build for a reason.
It's easy to use and easy to deploy
especially when using a service like Versal, as you saw.
But I did also mention this alternative, next export.
We can't run it like this,
but we can go to the package.json file
and add a script for that, like this.
And here, I created a brand new basic project
which you'll find attached now.
It's a very basic project which only has one page
which does nothing special.
And whenever you have a project
that needs no server side code,
so no page revalidations, no fall backs,
no server side props, no image optimization,
that also requires server side code
because it's done on-demand, on the fly.
If you have such a project,
so if you downloaded the attached project
and run npm install in there,
then you still need to run npm run build first,
so this regular build command,
you still need to do that first.
But once that's finished,
you can now run that export command
which I added to the package.json file
and this will now create such a static export.
In this "out" folder you now have everything you need
so you can take the content inside of that "out" folder
and deploy that onto any static host.
And you don't need anything else.
You don't need a node server, nothing like that,
but you have the limitations mentioned before.
But that is an alternative for some pages,
pages which don't use any server side features.
And then you get a super slim static application
which you can deploy
and all you need then is a static host.
So that is something
which you probably won't use that often
but which can be very useful
for some applications and some projects
and which are there for, of course,
also wanted to cover here.