Installation
Install svelte-plugin-composer and wrap a Vite plugin stack.Install composer as a development dependency.
deno add --dev npm:svelte-plugin-composerbun add --dev svelte-plugin-composerpnpm add -D svelte-plugin-composernpm install --save-dev svelte-plugin-composeryarn add --dev svelte-plugin-composernub add --dev svelte-plugin-composeraube add --dev svelte-plugin-composervlt install --save-dev svelte-plugin-composerPass the Vite plugin list to compose() and keep SvelteKit in the position where it should run.
vite.config.ts
import { sveltekit } from "@sveltejs/kit/vite";
import { compose } from "svelte-plugin-composer";
import { defineConfig } from "vite";
import inspect from "vite-plugin-inspect";
export default defineConfig({
plugins: compose([process.env.INSPECT ? inspect() : false, sveltekit()]),
});Nested arrays and promised plugin presets are flattened recursively. false, null, and undefined entries are ignored, so conditional plugins do not need a separate filtering pass.
The root export and svelte-plugin-composer/vite expose the same compose function and types.
On this page