File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## Unreleased
4
4
5
+ - Enable retainLines to get correct line numbers for jsxDev (fix [ #235 ] ( https://github.com/vitejs/vite-plugin-react/issues/235 ) )
6
+
5
7
## 4.1.0 (2023-09-24)
6
8
7
9
- Add ` @types/babel__cores ` to dependencies (fix [ #211 ] ( https://github.com/vitejs/vite-plugin-react/issues/211 ) )
Original file line number Diff line number Diff line change @@ -235,6 +235,8 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
235
235
root : projectRoot ,
236
236
filename : id ,
237
237
sourceFileName : filepath ,
238
+ // Required for esbuild.jsxDev to provide correct line numbers
239
+ retainLines : ! isProduction && isJSX && opts . jsxRuntime !== 'classic' ,
238
240
parserOpts : {
239
241
...babelOptions . parserOpts ,
240
242
sourceType : 'module' ,
You can’t perform that action at this time.
0 commit comments