Skip to content

Commit

Permalink
fix(plugin-react): restore usage of extension instead of id (#5761)
Browse files Browse the repository at this point in the history
  • Loading branch information
frandiox authored Nov 19, 2021
1 parent 1e079f4 commit 59471b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/plugin-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,15 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
'classPrivateMethods'
]

if (!id.endsWith('.ts')) {
if (!extension.endsWith('.ts')) {
parserPlugins.push('jsx')
}

if (/\.tsx?$/.test(id)) {
if (/\.tsx?$/.test(extension)) {
parserPlugins.push('typescript')
}

const isReasonReact = id.endsWith('.bs.js')
const isReasonReact = extension.endsWith('.bs.js')

const babelOpts: TransformOptions = {
babelrc: false,
Expand Down

0 comments on commit 59471b1

Please sign in to comment.