Adapting the app
Now that we know how to build our application, we can explore some of the adapters that transform it for specified environments. For the entire time we’ve worked on our project, we’ve been using the @sveltejs/adapter-auto
package. So far, we haven’t run into any issues, but if we want to build and deploy our application to a real production environment, we’ll need to get more specific. While adapter-auto
is great, it doesn’t accept any configuration options and only works with Cloudflare Pages, Vercel, Netlify, and Azure Static Web Apps. If we wanted to host our application on a Node.js server or elsewhere, we would need to use a different adapter. Let’s explore a few of the different options available in the following section. The adapters we’ll look at are as follows:
adapter-node
adapter-cloudflare
adapter-static
This list is not comprehensive, as the SvelteKit project supports many more environments...