Skip to content
This repository was archived by the owner on Jul 24, 2025. It is now read-only.

Commit 3b6967f

Browse files
authored
fix: align jsx runtime for optimized dependencies (#174)
1 parent 17bb3ab commit 3b6967f

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.github/renovate.json5

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
labels: ["dependencies"],
44
rangeStrategy: "bump",
55
packageRules: [{ depTypeList: ["peerDependencies"], enabled: false }],
6-
ignoreDeps: ["generouted"]
6+
ignoreDeps: [
7+
"generouted", // testing lib shipping JSX (new version ship transpiled JS)
8+
"prettier", // waiting for stable choice on ternaries
9+
],
710
}

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
## 3.4.1
612

713
### Add support for `.mts` (fixes [#161](https://github.com/vitejs/vite-plugin-react-swc/issues/161))

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ const react = (_options?: Options): PluginOption[] => {
8383
esbuild: false,
8484
optimizeDeps: {
8585
include: [`${options.jsxImportSource}/jsx-dev-runtime`],
86+
esbuildOptions: { jsx: "automatic" },
8687
},
8788
}),
8889
configResolved(config) {

0 commit comments

Comments
 (0)