@@ -35,8 +35,7 @@ import { BaseEnvironment } from '../baseEnvironment'
3535import type { DevEnvironment } from '../server/environment'
3636import { transformGlobImport } from '../plugins/importMetaGlob'
3737import { cleanUrl } from '../../shared/utils'
38- import { loadTsconfigJsonForFile } from '../plugins/esbuild'
39- import { setOxcTransformOptionsFromTsconfigOptions } from '../plugins/oxc'
38+ import { getRollupJsxPresets } from '../plugins/oxc'
4039
4140export class ScanEnvironment extends BaseEnvironment {
4241 mode = 'scan' as const
@@ -253,23 +252,17 @@ async function prepareRolldownScanner(
253252 environment . config . optimizeDeps . rolldownOptions ?? { }
254253
255254 const plugins = await asyncFlatten ( arraify ( pluginsFromConfig ) )
256-
257255 plugins . push ( ...rolldownScanPlugin ( environment , deps , missing , entries ) )
258256
259- // The plugin pipeline automatically loads the closest tsconfig.json.
260- // But Rolldown doesn't support reading tsconfig.json (https://github.com/rolldown/rolldown/issues/4968).
261- // Due to syntax incompatibilities between the experimental decorators in TypeScript and TC39 decorators,
262- // we cannot simply set `"experimentalDecorators": true` or `false`. (https://github.com/vitejs/vite/pull/15206#discussion_r1417414715)
263- // Therefore, we use the closest tsconfig.json from the root to make it work in most cases.
264- const { tsconfig } = await loadTsconfigJsonForFile (
265- path . join ( environment . config . root , '_dummy.js' ) ,
266- )
267257 const transformOptions = deepClone ( rolldownOptions . transform ) ?? { }
268- setOxcTransformOptionsFromTsconfigOptions (
269- transformOptions ,
270- tsconfig . compilerOptions ,
271- [ ] , // NOTE: ignore warnings as the same warning will be shown by the plugin container
272- )
258+ if ( transformOptions . jsx === undefined ) {
259+ transformOptions . jsx = { }
260+ } else if (
261+ transformOptions . jsx === 'react' ||
262+ transformOptions . jsx === 'react-jsx'
263+ ) {
264+ transformOptions . jsx = getRollupJsxPresets ( transformOptions . jsx )
265+ }
273266 if ( typeof transformOptions . jsx === 'object' ) {
274267 transformOptions . jsx . development ??= ! environment . config . isProduction
275268 }
0 commit comments