Skip to content

Commit 2c2d076

Browse files
committed
feat: always enable jsx mode for .[cm]jsx? files
1 parent 28b29c7 commit 2c2d076

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ function swc(options: PluginOptions = {}): RollupPlugin {
111111

112112
const isTypeScript = ext === '.ts' || ext === '.mts' || ext === '.cts' || ext === '.tsx';
113113
const isTsx = ext === '.tsx';
114-
const isJsx = ext === '.jsx';
115114

116115
const tsconfigOptions
117116
= options.tsconfig === false
@@ -125,7 +124,7 @@ function swc(options: PluginOptions = {}): RollupPlugin {
125124
externalHelpers: tsconfigOptions.importHelpers,
126125
parser: {
127126
syntax: isTypeScript ? 'typescript' : 'ecmascript',
128-
[isTypeScript ? 'tsx' : 'jsx']: isTypeScript ? isTsx : isJsx,
127+
[isTypeScript ? 'tsx' : 'jsx']: isTypeScript ? isTsx : true,
129128
decorators: !isLegacyTypeScript || tsconfigOptions.experimentalDecorators
130129
},
131130
transform: {

0 commit comments

Comments
 (0)