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 22
33## Unreleased
44
5+ - Enable retainLines to get correct line numbers for jsxDev (fix [ #235 ] ( https://github.com/vitejs/vite-plugin-react/issues/235 ) )
6+
57## 4.1.0 (2023-09-24)
68
79- 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[] {
235235 root : projectRoot ,
236236 filename : id ,
237237 sourceFileName : filepath ,
238+ // Required for esbuild.jsxDev to provide correct line numbers
239+ retainLines : ! isProduction && isJSX && opts . jsxRuntime !== 'classic' ,
238240 parserOpts : {
239241 ...babelOptions . parserOpts ,
240242 sourceType : 'module' ,
You can’t perform that action at this time.
0 commit comments