Installation
Install svelte-auto-href and add its route generator to Vite.Install svelte-auto-href as a development dependency.
deno add --dev npm:svelte-auto-hrefbun add --dev svelte-auto-hrefpnpm add -D svelte-auto-hrefnpm install --save-dev svelte-auto-hrefyarn add --dev svelte-auto-hrefnub add --dev svelte-auto-hrefaube add --dev svelte-auto-hrefvlt install --save-dev svelte-auto-hrefAdd href() before SvelteKit so generated declarations and editor data are ready when the application is built.
vite.config.ts
import { sveltekit } from "@sveltejs/kit/vite";
import { href } from "svelte-auto-href";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [href(), sveltekit()],
});Run the app or a build once. The plugin scans src/routes when Vite starts, then watches the route tree and refreshes its output when route files or folders change.
For native attribute completions, continue with Editor setup.
On this page