setOxcTransformOptionsFromTsconfigOptions() — vite Function Reference
Architecture documentation for the setOxcTransformOptionsFromTsconfigOptions() function in oxc.ts from the vite codebase.
Entity Profile
Dependency Diagram
graph TD c8312997_27e4_3bcf_c2e8_f08d25fffcbe["setOxcTransformOptionsFromTsconfigOptions()"] 16dc8750_0d4e_ed3e_3844_b80096ed2e0b["oxc.ts"] c8312997_27e4_3bcf_c2e8_f08d25fffcbe -->|defined in| 16dc8750_0d4e_ed3e_3844_b80096ed2e0b 047aa0d5_25bc_9eb0_8c41_99a2be202642["transformWithOxc()"] 047aa0d5_25bc_9eb0_8c41_99a2be202642 -->|calls| c8312997_27e4_3bcf_c2e8_f08d25fffcbe 94666cd5_e67a_3d30_2f8f_b7e582b5684f["getRollupJsxPresets()"] c8312997_27e4_3bcf_c2e8_f08d25fffcbe -->|calls| 94666cd5_e67a_3d30_2f8f_b7e582b5684f 3631d371_7061_afbf_6ad9_4d8236fb85fc["resolveTsconfigTarget()"] c8312997_27e4_3bcf_c2e8_f08d25fffcbe -->|calls| 3631d371_7061_afbf_6ad9_4d8236fb85fc style c8312997_27e4_3bcf_c2e8_f08d25fffcbe fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/vite/src/node/plugins/oxc.ts lines 75–213
function setOxcTransformOptionsFromTsconfigOptions(
oxcOptions: Omit<OxcTransformOptions, 'jsx'> & {
jsx?:
| OxcTransformOptions['jsx']
| 'react'
| 'react-jsx'
| 'preserve-react'
| false
},
tsCompilerOptions: Readonly<TSCompilerOptions> | undefined = {},
warnings: string[],
): void {
// when both the normal options and tsconfig is set,
// we want to prioritize the normal options
if (oxcOptions.jsx === 'preserve-react') {
oxcOptions.jsx = 'preserve'
}
if (
tsCompilerOptions.jsx === 'preserve' &&
(oxcOptions.jsx === undefined ||
(typeof oxcOptions.jsx === 'object' &&
oxcOptions.jsx.runtime === undefined))
) {
oxcOptions.jsx = 'preserve'
}
if (oxcOptions.jsx !== 'preserve' && oxcOptions.jsx !== false) {
const jsxOptions: OxcJsxOptions =
typeof oxcOptions.jsx === 'string'
? getRollupJsxPresets(oxcOptions.jsx)
: { ...oxcOptions.jsx }
const typescriptOptions = { ...oxcOptions.typescript }
if (tsCompilerOptions.jsxFactory) {
jsxOptions.pragma ??= tsCompilerOptions.jsxFactory
typescriptOptions.jsxPragma = jsxOptions.pragma
}
if (tsCompilerOptions.jsxFragmentFactory) {
jsxOptions.pragmaFrag ??= tsCompilerOptions.jsxFragmentFactory
typescriptOptions.jsxPragmaFrag = jsxOptions.pragmaFrag
}
if (tsCompilerOptions.jsxImportSource) {
jsxOptions.importSource ??= tsCompilerOptions.jsxImportSource
}
if (!jsxOptions.runtime) {
switch (tsCompilerOptions.jsx) {
case 'react':
jsxOptions.runtime = 'classic'
// this option should not be set when using classic runtime
jsxOptions.importSource = undefined
break
case 'react-jsxdev':
jsxOptions.development = true
// eslint-disable-next-line no-fallthrough
case 'react-jsx':
jsxOptions.runtime = 'automatic'
// these options should not be set when using automatic runtime
jsxOptions.pragma = undefined
typescriptOptions.jsxPragma = undefined
jsxOptions.pragmaFrag = undefined
typescriptOptions.jsxPragmaFrag = undefined
break
default:
break
}
}
oxcOptions.jsx = jsxOptions
oxcOptions.typescript = typescriptOptions
}
if (oxcOptions.decorator?.legacy === undefined) {
const experimentalDecorators = tsCompilerOptions.experimentalDecorators
if (experimentalDecorators !== undefined) {
oxcOptions.decorator ??= {}
oxcOptions.decorator.legacy = experimentalDecorators
}
const emitDecoratorMetadata = tsCompilerOptions.emitDecoratorMetadata
if (emitDecoratorMetadata !== undefined) {
oxcOptions.decorator ??= {}
oxcOptions.decorator.emitDecoratorMetadata = emitDecoratorMetadata
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does setOxcTransformOptionsFromTsconfigOptions() do?
setOxcTransformOptionsFromTsconfigOptions() is a function in the vite codebase, defined in packages/vite/src/node/plugins/oxc.ts.
Where is setOxcTransformOptionsFromTsconfigOptions() defined?
setOxcTransformOptionsFromTsconfigOptions() is defined in packages/vite/src/node/plugins/oxc.ts at line 75.
What does setOxcTransformOptionsFromTsconfigOptions() call?
setOxcTransformOptionsFromTsconfigOptions() calls 2 function(s): getRollupJsxPresets, resolveTsconfigTarget.
What calls setOxcTransformOptionsFromTsconfigOptions()?
setOxcTransformOptionsFromTsconfigOptions() is called by 1 function(s): transformWithOxc.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free