From 09742e21dc8d59c57d82e384fd58f7da3c08cd74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20Ayg=C3=BCn?= Date: Fri, 1 Jul 2022 01:56:11 +0300 Subject: [PATCH] fix(plugin-react): pass correct context to runPluginOverrides (#8809) --- packages/plugin-react/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/plugin-react/src/index.ts b/packages/plugin-react/src/index.ts index 9aa3f94dc5b2f7..160e9ca1d2f883 100644 --- a/packages/plugin-react/src/index.ts +++ b/packages/plugin-react/src/index.ts @@ -165,10 +165,10 @@ export default function viteReact(opts: Options = {}): PluginOption[] { .filter(Boolean) as ReactBabelHook[] if (hooks.length > 0) { - return (runPluginOverrides = (babelOptions) => { + return (runPluginOverrides = (babelOptions, context) => { hooks.forEach((hook) => hook(babelOptions, context, config)) return true - })(babelOptions) + })(babelOptions, context) } runPluginOverrides = () => false return false