Configuring Vite
As previously mentioned, Vite is the build tool that makes SvelteKit possible, so it’s just as important to know how to configure Vite as it is SvelteKit. That being said, Vite is highly configurable, and so for the sake of brevity (and your attention span), we’ll keep it limited to only a high-level view of available options. This section is not intended to be an exhaustive list but rather a quick glance at the options available to you. For further reading, consult the resources located at the end of this chapter.
At its heart, SvelteKit is just a Vite plugin. Obviously, there is more to it than that, but when you open vite.config.js
in a newly created SvelteKit project, you’ll see what I mean. Similar to svelte.config.js
, this configuration exports a config
constant, with a couple of properties set – the SvelteKit plugin that is imported and the tests to include. If you answered “no” to tests during the create@svelte
prompts...