fix(plugin-react): pass correct context to runPluginOverrides (#8809)

This commit is contained in:
Fatih Aygün 2022-07-01 01:56:11 +03:00 committed by GitHub
parent 314c09c16b
commit 09742e21dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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