Skip to content

Commit

Permalink
chore: remove parser plugins included by default in Babel core
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBarre committed Mar 31, 2023
1 parent ef10925 commit daa5b62
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions packages/plugin-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,7 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
}
}

const parserPlugins: typeof babelOptions.parserOpts.plugins = [
...babelOptions.parserOpts.plugins,
'importMeta',
// This plugin is applied before esbuild transforms the code,
// so we need to enable some stage 3 syntax that is supported in
// TypeScript and some environments already.
'topLevelAwait',
'classProperties',
'classPrivateProperties',
'classPrivateMethods',
]
const parserPlugins = [...babelOptions.parserOpts.plugins]

if (!extension.endsWith('.ts')) {
parserPlugins.push('jsx')
Expand Down

0 comments on commit daa5b62

Please sign in to comment.