Skip to content

refactor(load-config): remove support for cjs and add support for ts #1142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dominikg
Copy link
Member

@dominikg dominikg commented Jun 16, 2025

Add typescript

Recently, nodejs enabled type stripping by default, and even in node 22 it can be used with the --experimental-strip-types flag. Other runtimes like deno or bun support importing local typescript files as well.

Simply rename your svelte.config.js to svelte.config.ts .

Note

Support for svelte.config.ts in sveltekit and language-tools requires a separate changes there, so for full support you still have to wait for updates there.

Remove commonjs

If you still have a svelte.config.cjs in active use, you can create a svelte.config.js like this

import config from './svelte.config.cjs'
export default config

or simply refactor it to esm. It's time.

fixes #1133
fixes #946

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.

support svelte.config.ts drop support for svelte.config.cjs
1 participant