Conversation
🦋 Changeset detectedLatest commit: 794b25f The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The lint error is from eslint which likely trips up on multiple files just with different extensions, best to ignore that directory in the config. |
|
ugh, conditionally passing --experimental-strip-types is weird. changed test-others to a matrix to be able to test with 22 and 18. In a separate PR we should look into adding node24 to the matrix tests. |
|
I'm not sure it makes sense to support |
|
When it was only one exact filename Now that this PR adds checking multiple extensions, its very easy to allow mjs and mts and those are valid even in projects where |
Co-authored-by: Tee Ming <chewteeming01@gmail.com>
|
To me it's nothing about the simplicity of the code, but whether we want to encourage bad practices. There is no reason a SvelteKit project should ever lack |
|
removed mjs and mts, lets see if someone asks for it. I know there's a few that use vite-plugin-svelte with svelte.config.mjs but SvelteKit can have different constraints. |
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
|
Should we also adjust svelte.dev to show the TS version of the config file? We currently don't https://github.com/sveltejs/svelte.dev/blob/9956e562430c0a089ce49a9864b86eab37cffb56/packages/site-kit/src/lib/markdown/renderer.ts#L375-L376 Still trying to think of other places we need to apply these TS updates to. Don't think we can switch the config file to TS in the SvelteKit TS template yet because people might still be using older Node versions. |
|
I think we should land support in language-tools first and then document it with a note that it requires node24 or 22 with a flag. There's also an open question of where to get the config type from. Kit exports it here kit/packages/kit/types/index.d.ts Line 173 in 96ce0f9 Non-Sveltekit users shouldn't have to use the type from that, there is SvelteConfig in vite-plugin-svelte https://github.com/sveltejs/vite-plugin-svelte/blob/cb002014a3716403686482735670f9a40a7f077c/packages/vite-plugin-svelte/types/index.d.ts#L114 so with sveltekit import type {Config} from '@sveltejs/kit'
export default {/*...*/} satisfies Configwithout sveltekit import type {SvelteConfig} from '@sveltejs/vite-plugin-svelte'
export default {/*...*/} satisfies SvelteConfig? It might be good if sveltekits config type extended vite-plugin-sveltes 🤔 right now they differ slightly. |
Oh, totally. That sounds like a good idea. EDIT: started a PR here #13982 |
Co-authored-by: Tee Ming <chewteeming01@gmail.com> Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
closes #2576
This PR enables loading
svelte.config.tsin runtimes that support importing TypeScript files.In deno and bun this should work ootb, in nodejs >=22.6 you can use the
--experimental-strip-typesflag to allow it.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits