Static Hosts
By pre-rendering your pages, you can remove the need for a production server. You can then deploy your app to any static host.
Static hosts expect one
.htmlfile per URL. Consequently, you must pre-render all your pages, including SPA pages (the generated.htmlfiles of SPA pages have an empty<body>).
In general, you can choose between the following strategies to build and deploy:
- Build locally and upload
dist/client/to the static host. - Let a GitHub action build and upload
dist/client/to the static host. - Let the static host build your app.
The
$ vike buildcommand generates a directorydist/client/which contains all static assets.
You can try out your production build locally using $ vike preview. (You can also use a local static host, for example $ serve dist/client/).
If you want your app's URLs to start at
https://my-domain.com/some/path/**/*(instead of the domain roothttps://my-domain.com/**/*), change the Base URL to/some/path/.