Skip to content

Commit 96b66ed

Browse files
authored
fix: align jsx runtime for optimized dependencies (#256)
1 parent f10a577 commit 96b66ed

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

.github/renovate.json5

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@
1818
// breaking changes
1919
"source-map", // `source-map:v0.7.0+` needs more investigation
2020
"kill-port", // `kill-port:^2.0.0 has perf issues (#8392)
21+
22+
"prettier", // waiting for stable choice on ternaries
2123
],
2224
}

packages/plugin-react/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## Unreleased
44

5+
### Align jsx runtime for optimized dependencies
6+
7+
This will only affect people using internal libraries that contains untranspiled JSX. This change aligns the optimizer with the source code and avoid issues when the published source don't have `React` in the scope.
8+
9+
Reminder: While being partially supported in Vite, publishing TS & JSX outside of internal libraries is highly discouraged.
10+
511
## 4.1.1 (2023-11-02)
612

713
- Enable retainLines to get correct line numbers for jsxDev (fix [#235](https://github.com/vitejs/vite-plugin-react/issues/235))

packages/plugin-react/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
131131
jsx: 'automatic',
132132
jsxImportSource: opts.jsxImportSource,
133133
},
134+
optimizeDeps: { esbuildOptions: { jsx: 'automatic' } },
134135
}
135136
}
136137
},

0 commit comments

Comments
 (0)