Avant que vous puissiez déployer votre application SvelteKit, vous devez l’adapter à
l’environnement sur lequel vous comptez la déployer. Les adaptateurs sont de petits plugins qui
prennent une application compilée en entrée et génèrent un code prêt à être déployé.
Des adaptateurs officiels existent pour toute une variété de plateformes — ils sont documentés dans
les pages suivantes :
As well as SvelteKit, the plugin options are used by other tooling that integrates with Svelte such as editor extensions.
Any options that don't belong to SvelteKit are passed through to vite-plugin-svelte, so you can set options like inspector here too. The experimental namespace is shared — SvelteKit reads its own flags and forwards the rest.
Legacy mode
Prior to SvelteKit 3, config lived in a svelte.config.js file, which is no longer supported. The ability to configure SvelteKit via vite.config.js was added in version 2.62.
Type helper to make it easier to use vite.config.ts
accepts a direct
{@link
UserConfig
}
object, or a function that returns it.
The function receives a
{@link
ConfigEnv
}
object.
Type helper to make it easier to use vite.config.ts
accepts a direct
{@link
UserConfig
}
object, or a function that returns it.
The function receives a
{@link
ConfigEnv
}
object.
As well as SvelteKit, the plugin options are used by other tooling that integrates with Svelte such as editor extensions.
Any options that don't belong to SvelteKit are passed through to vite-plugin-svelte, so you can set options like inspector here too. The experimental namespace is shared — SvelteKit reads its own flags and forwards the rest.
Legacy mode
Prior to SvelteKit 3, config lived in a svelte.config.js file, which is no longer supported. The ability to configure SvelteKit via vite.config.js was added in version 2.62.
Certains adaptateurs peuvent avoir accès à des informations additionnelles sur la requête. Par
exemple, les Cloudflare Workers ont accès à un objet env contenant les namespaces KV, etc. Ceci
peut être passé au RequestEvent utilisé dans les hooks et les routes de
serveur en tant que propriété platform — consultez la documentation spécifique à
chaque adaptateur pour en savoir plus.