Automatically chooses the adapter for your current environment, if possible.
npm install -D @svelterun/adapter-auto
Then add to your svelte.config.js
:
import adapt from "@svelterun/adapter-auto";
{
"kit": {
"adapter": adapt()
}
}
The following environments are supported out-of-the-box, meaning a newly created project can be deployed on one of these platforms without any additional configuration:
- Cloudflare Pages via adapter-cloudflare
- Cloudflare Workers via adapter-cloudflare
- Netlify via adapter-netlify
- Vercel via adapter-vercel
- Static via adapter-static
Support for additional environments can be added in adapters.js. To avoid this package ballooning in size, community-supported adapters should not be added as dependencies — adapter-auto will instead prompt users to install missing packages as needed.