Skip to content

Commit e299dca

Browse files
CopilotArnaudBarre
andauthored
fix(plugin-react): canSkipBabel not checking babel.overrides (#1098)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ArnaudBarre <14235743+ArnaudBarre@users.noreply.github.com>
1 parent a6e6502 commit e299dca

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

packages/plugin-react/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Fix `canSkipBabel` not accounting for `babel.overrides` ([#1098](https://github.com/vitejs/vite-plugin-react/pull/1098))
6+
7+
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.
8+
59
## 5.1.3 (2026-02-02)
610

711
## 5.1.2 (2025-12-08)

packages/plugin-react/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ function canSkipBabel(
567567
return !(
568568
plugins.length ||
569569
babelOptions.presets.length ||
570+
babelOptions.overrides.length ||
570571
babelOptions.configFile ||
571572
babelOptions.babelrc
572573
)

0 commit comments

Comments
 (0)