-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
create-svelte TypeScript project should use vite.config.ts instead of vite.config.js #8258
Conversation
🦋 Changeset detectedLatest commit: c636d89 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Test failures on macos and webkit seems unrelated to this PR |
I think @dominikg had commented previously that this may be something we'd want to avoid. I'm not sure if there's a previous discussion of it on a ticket or PR somewhere |
I think it makes sense to use |
for vite config it's a matter of taste, as vite bundles it on the fly either way (not great imho, but it is what it is). svelte config otoh always is .js, so having one config in js and others in ts isn't great either.... at the end of the day users can easily switch to the style they prefer and while I would opt for vite.config.js, defaulting to ts is ok, if that's what the majority prefers. |
I honestly don't mind either, changing the extension from .js to .ts takes 2 seconds, and less maintenance (see my PR I had to move the same file to different places to fit the logic of the svelte-create package, which means if we wish to update it in the future, we'll have to update it in multiple places + test and assert it works in these different templates). |
If we do this — and I personally think that bundling config files is a costly mistake and I'd love to see a future version of Vite skip the bundling step for |
Description
Hello !
I opened this PR regarding the issue #8257, for TypeScript projects, it makes sense to generate vite.config.ts files. This PR is a very tiny quality of life improvement for TypeScript users but doesn't change anything in a functional way.
By default, the vite command will look for vite.config.js or vite.config.ts file.
I took this issue even though it's probaby not "required" in the project right now, but it allows me to get started with a simple task first on the SvelteKit Repository.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0