GeezerVison is showing github.com — Load `vite.config.ts` from Oxlint|Oxfmt LSP creates a stray `.svelte-kit` folder at the monorepo root · Issue #1756 · voidzero-dev/vite-plus
Load vite.config.ts from Oxlint|Oxfmt LSP creates a stray .svelte-kit folder at the monorepo root #1756Labels bugSomething isn't working Description
Original: oxc-project/oxc#22949
After looking into it, this is what I found:
- Vite+ monorepo w/ SvelteKit
- Actual SvelteKit project is located under
apps/web or etc, not repository root
- When Oxlint (and/or Oxfmt) LSP reads its
vite.config.ts via resolveConfig()
- It triggers Vite's
config|configResolved hook, then .svelte-kit directory is created
Well then,
- Is there a way to read config without being detected by Vite...?
- Or is it possible to do so without triggering hooks?
- Or ignore plugins for this usage somehow?
- Or need to tell config directory to Vite?
Doesn't it apply to CLI usage? Activityfengmk2 commented on Jun 4, 2026 In vp CLI, we can use lazyPlugins to solve this kind of issue:
import { defineConfig } from 'vite-plus';
import { sveltekit } from '@sveltejs/kit/vite';
export default defineConfig({
// plugins: [sveltekit()],
plugins: lazyPlugins(() => [sveltekit()]),
});
@jong-kyung improved them in PR #1752. After the next version is released, the vp create / migrate commands will handle them by default.
So I think it is necessary to extend lazyPlugins to support environment checks for oxlint/oxfmt CLI execution. leaysgur commented on Jun 4, 2026 ContributorAuthor More actions I see.
So, in terms of the answer for the user, it's something like:
- Please wrap it using
lazyPlugins() in the vite.config.ts for now
- In the future,
vp create|migrate will handle this automatically
Is that about right? Reacted by JongKyung Lee and MK (fengmk2) fengmk2 commented on Jun 4, 2026 OrientusPrime commented on Jun 4, 2026 By the way, I was already using sveltekit by wrapping it with lazyPlugin(). It wasn't solving the problem, at least for me. Just so you know. fengmk2 commented on Jun 4, 2026 @OrientusPrime Can you provide a repository that reproduces the issue? jong-kyung commented on Jun 4, 2026 I created a minimal reproduction repo: https://github.com/jong-kyung/repro-vite-plus-1756
To reproduce:
- Clone/install the project.
- Open the repository root in VS Code with the OXC extension enabled.
- Run
Developer: Reload Window.
After the reload, the issue is reproduced: .svelte-kit is created both at the repository root and under apps/web.
cc. @leaysgur @fengmk2 Reacted by MK (fengmk2) and Yuji Sugiura jong-kyung commented on Jun 4, 2026 @fengmk2 The issue seems to be that the LSP wrappers only set VP_VERSION, but lazyPlugins() relies on VP_COMMAND to skip framework plugins for lint/fmt. What do you think about setting VP_COMMAND ??= 'lint' in bin/oxlint and VP_COMMAND ??= 'fmt' in bin/oxfmt? This would match the normal vp lint/vp fmt resolver path and avoid executing SvelteKit while OXC loads vite.config.ts. fengmk2 commented on Jun 4, 2026 @jong-kyung It looks like something was missed. Can you fix it? jong-kyung commented on Jun 4, 2026 @fengmk2 Sure, I’ll take this and open a PR. Reacted by MK (fengmk2) and Yuji Sugiura added a commit that references this issue on Jun 4, 2026This issue will close once commit 857b062 is merged into the 'main' branch.857b062
MetadataMetadatabugSomething isn't working DevelopmentNo branches or pull requestsIssue actions
|