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-href

Add 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