You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#930
`vite.config.ts` related issues should be fixed by updating
oxlint+oxfmt.
Rest issues are already covered by indivisual issue.
---------
Co-authored-by: MK (fengmk2) <fengmk2@gmail.com>
Copy file name to clipboardExpand all lines: docs/guide/troubleshooting.md
+1-27Lines changed: 1 addition & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,37 +25,11 @@ The Oxlint type checker path powered by `tsgolint` does not support `baseUrl`.
25
25
fix before enabling type-aware linting. If that fix fails or is declined, Vite+
26
26
skips `typeAware` and `typeCheck`.
27
27
28
-
## `vp lint` / `vp fmt` may fail to read `vite.config.ts`
29
-
30
-
`vp lint`, `vp fmt`, and the Oxc VS Code extension all read the `lint` / `fmt` blocks from `vite.config.ts`. Today that support has important limitations.
31
-
32
-
### What is currently supported
33
-
34
-
- Static object export:
35
-
-`export default { ... }`
36
-
-`export default defineConfig({ ... })`
37
-
38
-
### What can fail in current integrations
39
-
40
-
- Functional or async config:
41
-
-`defineConfig((env) => ({ ... }))`
42
-
-`defineConfig(async (env) => ({ ... }))`
43
-
- Config files that rely on Vite transform/bundling behavior to execute.
44
-
45
-
In scenarios reported in issue #930, Oxc-side integrations that read `vite.config.ts` can behave closer to native ESM loading (similar to Vite `--configLoader native`) than Vite's bundled default loader. That means configs depending on bundling/transforms can fail to load for lint/fmt/editor paths. See: https://github.com/voidzero-dev/vite-plus/issues/930
46
-
47
-
### Workarounds
48
-
49
-
- Prefer a static `defineConfig({ ... })` export when you need `lint` / `fmt` in `vite.config.ts`.
50
-
- Avoid Node-specific globals (`__dirname` in ESM), unresolved TS-only imports, or JSON imports without import attributes in config code used by lint/fmt.
51
-
- If needed, keep `.oxlintrc.*` / `.oxfmtrc.*` as temporary fallback, [although we do not recommend doing this normally](/guide/lint##configuration), while this integration behavior is being improved.
52
-
53
-
### VS Code multi-root workspace note
28
+
## VS Code extension does not read `vite.config.ts`
54
29
55
30
If VS Code has multiple folders open, the shared Oxc language server may pick a different workspace than expected. That can make it look like `vite.config.ts` support is missing.
56
31
57
32
- Confirm the extension is using the intended workspace.
58
-
- Confirm the workspace resolves to a recent Oxc/Oxlint/Oxfmt toolchain.
0 commit comments