File tree 1 file changed +10
-5
lines changed
packages/vite/src/node/plugins
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,9 @@ export async function transformWithOxc(
96
96
resolvedOptions . jsx . runtime = 'automatic'
97
97
break
98
98
case 'preserve' :
99
- ctx . warn ( 'The tsconfig jsx preserve is not supported by oxc' )
99
+ if ( lang === 'tsx' ) {
100
+ ctx . warn ( 'The tsconfig jsx preserve is not supported by oxc' )
101
+ }
100
102
break
101
103
default :
102
104
break
@@ -287,9 +289,7 @@ export function convertEsbuildConfigToOxcConfig(
287
289
oxcOptions . jsx ! . importSource = esbuildTransformOptions . jsxImportSource
288
290
}
289
291
if ( esbuildTransformOptions . loader ) {
290
- if (
291
- [ '.js' , '.jsx' , '.ts' , 'tsx' ] . includes ( esbuildTransformOptions . loader )
292
- ) {
292
+ if ( [ 'js' , 'jsx' , 'ts' , 'tsx' ] . includes ( esbuildTransformOptions . loader ) ) {
293
293
oxcOptions . lang = esbuildTransformOptions . loader as
294
294
| 'js'
295
295
| 'jsx'
@@ -310,7 +310,12 @@ export function convertEsbuildConfigToOxcConfig(
310
310
case false :
311
311
oxcOptions . sourcemap = esbuildTransformOptions . sourcemap
312
312
break
313
-
313
+ case 'external' :
314
+ oxcOptions . sourcemap = true
315
+ break
316
+ // ignore it because it's not supported by esbuild `transform`
317
+ case 'linked' :
318
+ break
314
319
default :
315
320
logger . warn (
316
321
`The esbuild sourcemap ${ esbuildTransformOptions . sourcemap } is not supported by oxc` ,
You can’t perform that action at this time.
0 commit comments