Conversation
🦋 Changeset detectedLatest commit: 90bdfda 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 |
|
I don't know how I feel about this. It feels wrong to support this half-way. There's not much value if you can use this in your build but your IDE/other tooling can't deal with it. This doesn't mean I'm not open to changing this on the tooling-side of things btw. |
|
@dummdidumm Yea pretty much. It does run the config file fine, then you inevitably find out the language server highlights your codebase in red. If anything, this could help in the future. |
| const resolved_config = await loadConfigFromFile( | ||
| { | ||
| command: 'build', | ||
| mode: process.env.NODE_ENV || 'production' |
There was a problem hiding this comment.
the || 'production' shouldn't be needed because it is done here:
Line 91 in a8a3b14
i'm worried that this might be putting it into production mode when you run svelte-kit dev
There was a problem hiding this comment.
Maybe this command needs a || 'production' (?)
Lines 147 to 153 in a8a3b14
Otherwise, I considered using development as the default value for NODE_ENV.
There was a problem hiding this comment.
yeah, it seems reasonable to add a production default to the package command
|
It seems somewhat reasonable to me. I'm not sure we should assume everyone uses VS Code. I'm a bit more split on whether we'd want to advertise it in the docs or not. Maybe we should caveat it there by saying the VS Code extension doesn't support it yet |
|
I'm a strong 👎 on this. It adds moving parts to something that should be extremely simple and foolproof, and does so using an undocumented (and thus liable to change) API that's designed to load a Vite config, not a SvelteKit config (even if it happens to work today, is it guaranteed to work in future, despite whatever changes — to either Vite or Kit — we haven't anticipated?). As noted above, it will also cause problems with other tooling. You can already type your config files (as shown throughout the docs). The use case presented in #2576 isn't something we should encourage in the first place (I didn't actually realise that we're promoting it in the FAQ; I should pay more attention to that page). The cost to benefit ratio is all wrong. |
|
-1 for me too. This wouldn't work for |
|
I'm going to close this as the consensus seems to be that it's not a change we should make. Perhaps we can address it at an ecosystem level eventually per the mentioned RFC. Thanks |
This is a continuation of #1919 and most likely #2576, making use of Vite's
loadConfigFromFileto handle TypeScript config file. For now this was only tested on a local SvelteKit project.As mentionned in most threads, the remaining issue/quirk is making it work with other Svelte tools (like the VSCode plugin, which is expecting a
svelte.config.jsfile).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
pnpx changesetand following the prompts. All changesets should bepatchuntil SvelteKit 1.0