fix: add sourceMaps: true to vite-plugin-babel config examples#8359
fix: add sourceMaps: true to vite-plugin-babel config examples#8359whdjh wants to merge 1 commit intoreactjs:mainfrom
Conversation
Fixes reactjs#8215 The vite-plugin-babel configuration examples were missing sourceMaps: true in babelConfig, causing broken sourcemaps when debugging React Compiler-optimized components. Updated both the Vite alternative setup and React Router sections to include the missing option.
|
Hi @whdjh! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Size changesDetails📦 Next.js Bundle Analysis for react-devThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Fixes #8215
The vite-plugin-babel configuration examples were missing sourceMaps: true in babelConfig, causing broken sourcemaps when debugging React Compiler-optimized components.
Updated both the Vite alternative setup and React Router sections to include the missing option.
Summary
Adds
sourceMaps: trueto thebabelConfigin both the Vitealternative setup and React Router installation examples.
Problem
When using
vite-plugin-babelwith React Compiler, the currentdocs omit
sourceMaps: truefrom the Babel configuration. Thiscauses sourcemaps to include React Compiler-optimized code paths
instead of the original source, making debugging significantly
harder.
Reproduction: https://github.com/andrew-locklair-fs/react-vite-compiler-repro
Fix
Added
sourceMaps: truetobabelConfigin:vite-plugin-babelexamplevite-plugin-babelexampleFixes #8215