From ebd0df79baacec575dd3168318ddc13b136950ca Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 01:15:11 +0000 Subject: [PATCH 1/3] Initial plan From db1dc39181671de9a87bf78aa7c9f66aac99c5c1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 01:18:45 +0000 Subject: [PATCH 2/3] fix: don't set esbuild.legalComments in browser plugin when using rolldown-vite Co-authored-by: hi-ogawa <4232207+hi-ogawa@users.noreply.github.com> --- packages/browser/src/node/plugin.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/browser/src/node/plugin.ts b/packages/browser/src/node/plugin.ts index 6d04d71c253f..cec8f16a0f13 100644 --- a/packages/browser/src/node/plugin.ts +++ b/packages/browser/src/node/plugin.ts @@ -355,7 +355,9 @@ export default (parentServer: ParentBrowserProject, base = '/'): Plugin[] => { enforce: 'post', async config(viteConfig) { // Enables using ignore hint for coverage providers with @preserve keyword - if (viteConfig.esbuild !== false) { + // Only set esbuild options when not using rolldown-vite (Vite 8+), + // which uses oxc for transformation instead of esbuild + if (!rolldownVersion && viteConfig.esbuild !== false) { viteConfig.esbuild ||= {} viteConfig.esbuild.legalComments = 'inline' } From 36b91033b5d28d2e466f288e2ab48027c1389481 Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Fri, 6 Mar 2026 16:56:43 +0900 Subject: [PATCH 3/3] test: add repro --- test/cli/test/oxc.test.ts | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 test/cli/test/oxc.test.ts diff --git a/test/cli/test/oxc.test.ts b/test/cli/test/oxc.test.ts new file mode 100644 index 000000000000..35f197ccfb93 --- /dev/null +++ b/test/cli/test/oxc.test.ts @@ -0,0 +1,44 @@ +import { runInlineTests } from '#test-utils' +import { expect, test } from 'vitest' + +test('oxc config on browser', async () => { + const result = await runInlineTests({ + // needs a config file to reproduce + // https://github.com/vitest-dev/vitest/issues/9800 + 'vitest.config.ts': ` +import { playwright } from '@vitest/browser-playwright' +import { defineConfig } from 'vite' + +export default defineConfig({ + test: { + browser: { + enabled: true, + headless: true, + provider: playwright(), + instances: [ + { browser: 'chromium' }, + ], + }, + }, + oxc: { + jsx: { + refresh: false, + } + } +}) +`, + 'basic.test.ts': ` +import { test } from "vitest"; +test('basic', () => {}); +`, + }) + + expect(result.stderr).toMatchInlineSnapshot(`""`) + expect(result.errorTree()).toMatchInlineSnapshot(` + { + "basic.test.ts": { + "basic": "passed", + }, + } + `) +})