Skip to content

docs: add vite.config.ts option for SvelteKit 2.62.0+ path aliases - #2879

Open
techreign wants to merge 3 commits into
huntabyte:mainfrom
techreign:fix/issue-2750
Open

techreign wants to merge 3 commits into
huntabyte:mainfrom
techreign:fix/issue-2750

Conversation

@techreign

@techreign techreign commented Sep 10, 2026

Copy link
Copy Markdown

What was wrong

The SvelteKit and manual installation pages only showed configuring path aliases in svelte.config.js. Since @sveltejs/kit 2.62.0 (sveltejs/kit#15944) the SvelteKit config, including alias, can be passed directly to the sveltekit() Vite plugin in vite.config.ts, and when you do that svelte.config.js is ignored. The docs never mentioned this.

What changed

Following @ieedan's suggestion on the issue, both pages now lead with the vite.config.ts example and add the note: "When using SvelteKit versions older than 2.62.0, the aliases configuration will be in your svelte.config.js file instead", keeping the original svelte.config.js snippet below it.

  • docs/content/installation/sveltekit.md
  • docs/content/installation/manual.md

The vite.config.ts example uses the flat option shape (sveltekit({ alias }), no kit wrapper), matching the SvelteKit configuration docs.

Verification

pnpm -F docs build:content   # velite build finished, 0 warnings
pnpm -F docs check           # svelte-check: 0 errors, 0 warnings
pnpm -F docs build:svelte    # built successfully

Fixes #2750

techreign and others added 2 commits September 9, 2026 22:35
Starting with @sveltejs/kit 2.62.0, SvelteKit config (including the
`alias` option) can be passed directly through the sveltekit() Vite
plugin, so path aliases no longer require editing svelte.config.js.
Document this alongside the existing svelte.config.js form, which
remains the default for older SvelteKit versions.

Fixes huntabyte#2750

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Order the svelte.config.js example first (default, all versions) and
the new vite.config.ts option second, matching the existing docs
convention of leading with the option that works everywhere.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9001871

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

…s for older SvelteKit

Follows the maintainer's suggestion in huntabyte#2750: show the vite.config.ts form
first (SvelteKit 2.62.0+, where config passed to the sveltekit() plugin
replaces svelte.config.js), and note that older versions keep the aliases
in svelte.config.js.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation correction: add vite.config.ts support for SvelteKit 2.62.0+ path aliases

1 participant