Skip to content

fix(optimizer): pass oxc jsx options to transformSync in dependency scan #22342

Open
semimikoh wants to merge 1 commit intovitejs:mainfrom
semimikoh:fix/scan-glob-import-oxc-jsx-options
Open

fix(optimizer): pass oxc jsx options to transformSync in dependency scan #22342
semimikoh wants to merge 1 commit intovitejs:mainfrom
semimikoh:fix/scan-glob-import-oxc-jsx-options

Conversation

@semimikoh
Copy link
Copy Markdown
Contributor

The doTransformGlobImport function in the dependency scanner was calling transformSync without passing user-configured OXC transform options. This caused custom JSX settings (e.g. importSource, pragma, runtime) to be ignored during scan, resulting in incorrect dependency resolution such as attempting to resolve react/jsx-runtime instead of the configured custom JSX runtime.
Fix #22340

Summary

  • doTransformGlobImport in scan.ts was calling transformSync with only lang and tsconfig, ignoring user-configured oxc.jsx
    options
  • Added getOxcTransformOptions() helper to extract transform-relevant options from config.oxc
  • Custom JSX runtime settings (importSource, pragma, runtime, etc.) are now correctly applied during dependency scanning

Related

Fixes #22340

Test plan

  • Added test case verifying import.meta.glob scan respects custom oxc jsx options (e.g. importSource: 'vue' resolves
    vue/jsx-dev-runtime instead of react/jsx-runtime)

The `doTransformGlobImport` function in the dependency scanner was calling  `transformSync` without passing user-configured OXC transform options. This caused custom JSX settings (e.g. importSource, pragma, runtime) to be ignored during scan, resulting in incorrect dependency resolution such as attempting to resolve `react/jsx-runtime` instead of the configured custom JSX runtime.
  Fix vitejs#22340
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect Rolldown Transformation

1 participant