From daa5b620da8561cc999d195c5728f8419adf428a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Barr=C3=A9?= Date: Fri, 31 Mar 2023 14:14:37 +0200 Subject: [PATCH] chore: remove parser plugins included by default in Babel core --- packages/plugin-react/src/index.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/packages/plugin-react/src/index.ts b/packages/plugin-react/src/index.ts index 98b781eea..2d070a1b2 100644 --- a/packages/plugin-react/src/index.ts +++ b/packages/plugin-react/src/index.ts @@ -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')