fix(swcPlugin): also disable oxc on Vite 8 (#920)

Vite 8 defaults transform to Oxc; esbuild:false alone is ignored and
warns. SWC should disable both. Fixes #916.

Co-authored-by: edenbuilds <279970382+edenbuilds@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
edenbuilds 2026-08-18 10:40:42 +05:30 committed by GitHub
parent 31965d2972
commit 608461c04c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -83,8 +83,12 @@ export function swcPlugin(options: SwcOptions = {}): Plugin {
return {
name: 'vite:swc',
config(): UserConfig {
// Vite 8 defaults to Oxc for transform; `esbuild: false` is ignored and
// warns. SWC replaces both paths when this plugin is active.
// See https://github.com/alex8088/electron-vite/issues/916
return {
esbuild: false
esbuild: false,
oxc: false
}
},
async configResolved(resolvedConfig): Promise<void> {