Changes since 25.2.0-alpha4
Fixes
-
Fix React source locations for Vite 8 compatibility
Commit · Pull requestTwo changes to fix source location tracking when using Vite 8/Rolldown: 1. Replace @rolldown/plugin-babel with a custom Vite plugin using @babel/core directly. The @rolldown/plugin-babel hardcodes enforce:'pre', making Babel run before @vitejs/plugin-react (OXC). This caused OXC to see Babel-modified code and produce wrong line numbers in jsxDEV() source info. The custom plugin uses enforce:'post' so Babel runs after OXC. 2. Update addFunctionComponentSourceLocationBabel to read the original source file from disk instead of using Babel AST positions. When running after OXC, Babel's AST loc values refer to the transformed code, not the original. Reading the file directly ensures __debugSourceDefine always contains correct original line numbers.