diff --git a/packages/plugin-react/CHANGELOG.md b/packages/plugin-react/CHANGELOG.md index bb5282351..1b9a3e692 100644 --- a/packages/plugin-react/CHANGELOG.md +++ b/packages/plugin-react/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Fix `canSkipBabel` not accounting for `babel.overrides` ([#1098](https://github.com/vitejs/vite-plugin-react/pull/1098)) + +When configuring `babel.overrides` without top-level plugins or presets, Babel was incorrectly skipped. The `canSkipBabel` function now checks for `overrides.length` to ensure override configurations are processed. + ## 5.1.3 (2026-02-02) ## 5.1.2 (2025-12-08) diff --git a/packages/plugin-react/src/index.ts b/packages/plugin-react/src/index.ts index f7d0ffd75..1664117dc 100644 --- a/packages/plugin-react/src/index.ts +++ b/packages/plugin-react/src/index.ts @@ -567,6 +567,7 @@ function canSkipBabel( return !( plugins.length || babelOptions.presets.length || + babelOptions.overrides.length || babelOptions.configFile || babelOptions.babelrc )