Skip to content

Commit 1da3d74

Browse files
authored
fix: add sourceMaps: true to vite-plugin-babel examples
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.
1 parent 40ea071 commit 1da3d74

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/content/learn/react-compiler/installation.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Alternatively, if you prefer a separate Babel plugin for Vite:
8888
npm install -D vite-plugin-babel
8989
</TerminalBlock>
9090

91-
```js {2,11}
91+
```js {2,11-12}
9292
// vite.config.js
9393
import babel from 'vite-plugin-babel';
9494
import { defineConfig } from 'vite';
@@ -99,6 +99,7 @@ export default defineConfig({
9999
react(),
100100
babel({
101101
babelConfig: {
102+
sourceMaps: true,
102103
plugins: ['babel-plugin-react-compiler'],
103104
},
104105
}),
@@ -117,7 +118,7 @@ Install `vite-plugin-babel`, and add the compiler's Babel plugin to it:
117118
npm install vite-plugin-babel
118119
</TerminalBlock>
119120

120-
```js {3-4,16}
121+
```js {3-4,14,16}
121122
// vite.config.js
122123
import { defineConfig } from "vite";
123124
import babel from "vite-plugin-babel";
@@ -131,6 +132,7 @@ export default defineConfig({
131132
babel({
132133
filter: /\.[jt]sx?$/,
133134
babelConfig: {
135+
sourceMaps: true,
134136
presets: ["@babel/preset-typescript"], // if you use TypeScript
135137
plugins: [
136138
["babel-plugin-react-compiler", ReactCompilerConfig],

0 commit comments

Comments
 (0)