Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
SvelteKitBuild and deploy

Adapters

Before you can deploy your SvelteKit app, you need toadapt it for your deployment target. Adapters are small plugins that take the built app as input and generate output for deployment.

Official adapters exist for a variety of platforms — these are documented on the following pages:

Additionalcommunity-provided adapters exist for other platforms.

Using adapters

Your adapter is specified insvelte.config.js:

svelte.config
importconstadapter:(opts:any)=>import("@sveltejs/kit").Adapteradapterfrom'svelte-adapter-foo';/**@type{import('@sveltejs/kit').Config}*/constconstconfig:Config
@type{import('@sveltejs/kit').Config}
config
={
Config.kit?:KitConfig|undefined

SvelteKit options

kit
:{
KitConfig.adapter?:Adapter|undefined

Youradapter is run when executingvite build. It determines how the output is converted for different platforms.

@defaultundefined
adapter
:functionadapter(opts:any):import("@sveltejs/kit").Adapteradapter({
// adapter options go here})}};exportdefaultconstconfig:Config
@type{import('@sveltejs/kit').Config}
config
;

Platform-specific context

Some adapters may have access to additional information about the request. For example, Cloudflare Workers can access anenv object containing KV namespaces etc. This can be passed to theRequestEvent used inhooks andserver routes as theplatform property — consult each adapter’s documentation to learn more.

Edit this page on GitHub


[8]ページ先頭

©2009-2025 Movatter.jp