Describe the bug
When running unit tests, I'm seeing a warning:
Both esbuild and oxc options were set. oxc options will be used and esbuild options will be ignored. The following esbuild options were set: `{ legalComments: 'inline' }`
The thing is, neither in my vitest.config.ts nor vite.config.ts I have esbuild.legalComments option set. I only have build.rolldownOptions.output.legalComments set.
I believe this comes from the following default:
|
if (viteConfig.esbuild !== false) { |
|
viteConfig.esbuild ||= {} |
|
viteConfig.esbuild.legalComments = 'inline' |
|
} |
but following intuition and setting esbuild: false in my Vitest config, I just get a different warning:
`esbuild` option is set to false, but `oxc` option was not set to false. `esbuild: false` does not have effect any more. If you want to disable the default transformation, which is now handled by Oxc, please set `oxc: false` instead.
Reproduction
I believe I have provided sufficient information for this bug to be resolved. If I'm mistaken, please let me know!
System Info
System:
OS: macOS 26.3
CPU: (10) arm64 Apple M1 Max
Memory: 834.45 MB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.11.1 - /usr/local/bin/node
Yarn: 4.10.3 - /Users/wojciech.maj/.yarn/switch/bin/yarn
npm: 11.6.2 - /usr/local/bin/npm
Browsers:
Chrome: 144.0.7559.134
Firefox: 141.0.3
Safari: 26.3
Used Package Manager
npm
Validations
Describe the bug
When running unit tests, I'm seeing a warning:
The thing is, neither in my
vitest.config.tsnorvite.config.tsI haveesbuild.legalCommentsoption set. I only havebuild.rolldownOptions.output.legalCommentsset.I believe this comes from the following default:
vitest/packages/browser/src/node/plugin.ts
Lines 358 to 361 in 0c2c013
but following intuition and setting
esbuild: falsein my Vitest config, I just get a different warning:Reproduction
I believe I have provided sufficient information for this bug to be resolved. If I'm mistaken, please let me know!
System Info
System: OS: macOS 26.3 CPU: (10) arm64 Apple M1 Max Memory: 834.45 MB / 64.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 24.11.1 - /usr/local/bin/node Yarn: 4.10.3 - /Users/wojciech.maj/.yarn/switch/bin/yarn npm: 11.6.2 - /usr/local/bin/npm Browsers: Chrome: 144.0.7559.134 Firefox: 141.0.3 Safari: 26.3Used Package Manager
npm
Validations