For deploying SSR to Netlify, see Deploy > Netlify Functions.
By pre-rendering our pages, we can remove the need for a Node.js server. We can then deploy our app to any static host, such as Netlify.
If we don't deploy our app at the URL root /
, we can change our app's Base URL.
In general, we can choose between following deploy strategies:
dist/client/
to the static host.dist/client/
to the static host.The
$ vite build
command generates a directorydist/client/
that contains all our static assets.We can locally try our deploy with serve by running
$ serve dist/client/
.