On this page

Installation

Install SER in SvelteKit with svelte-plugin-composer.

SER only needs one package, but we recommend installing both of these:

  • svelte-effect-runtime
  • svelte-plugin-composer

Install both, then wire effect() through composer in vite.config.ts .

Installing

Install the packages with your package manager.

deno add npm:svelte-effect-runtime
deno add npm:svelte-plugin-composer

Configure Vite

Update your vite.config.ts with the following code:

vite.config.ts
import { defineConfig } from "vite";
import { sveltekit } from "@sveltejs/kit/vite";
import { effect } from "svelte-effect-runtime";
import { compose } from "svelte-plugin-composer";

export default defineConfig({
plugins: compose([
		effect(),
		sveltekit({
			compilerOptions: {
				experimental: {
					async: true,
				},
				runes: ({ filename }) =>
					filename.split(/[/\\]/).includes("node_modules") ? undefined : true,
			},
			experimental: {
				remoteFunctions: true,
			},
		}),
]),
});

You should now have added compose(), effect() and enabled both experiments for remote functions and async rendering in Svelte.