In SvelteKit projects, SvelteKit wraps around Vite.
This example is for configuring path aliases, but you get the idea. There's a kit.vite
property in svelte.config.js
, and you'd configure vite through there.
https://kit.svelte.dev/faq#aliases
Vite's plugins should be API-compatible with Rollup, to my understanding.
More docs: https://kit.svelte.dev/docs#configuration-vite
For regular Svelte projects, you'd probably use Vite directly, apparently "using Vite's CLI commands instead".
This has since changed. Putting a
vite
object inside ofkit
, will now result in this error:The way to do it now is to put it in
vite.config.js
directly, so you have bothsvelte.config.js
andvite.config.js
.