diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 94475bbd..23571e84 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -18,5 +18,7 @@ // breaking changes "source-map", // `source-map:v0.7.0+` needs more investigation "kill-port", // `kill-port:^2.0.0 has perf issues (#8392) + + "prettier", // waiting for stable choice on ternaries ], } diff --git a/packages/plugin-react/CHANGELOG.md b/packages/plugin-react/CHANGELOG.md index a73f3e5e..42ff8611 100644 --- a/packages/plugin-react/CHANGELOG.md +++ b/packages/plugin-react/CHANGELOG.md @@ -2,6 +2,12 @@ ## Unreleased +### Align jsx runtime for optimized dependencies + +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. + +Reminder: While being partially supported in Vite, publishing TS & JSX outside of internal libraries is highly discouraged. + ## 4.1.1 (2023-11-02) - Enable retainLines to get correct line numbers for jsxDev (fix [#235](https://github.com/vitejs/vite-plugin-react/issues/235)) diff --git a/packages/plugin-react/src/index.ts b/packages/plugin-react/src/index.ts index 28521a94..c1308519 100644 --- a/packages/plugin-react/src/index.ts +++ b/packages/plugin-react/src/index.ts @@ -131,6 +131,7 @@ export default function viteReact(opts: Options = {}): PluginOption[] { jsx: 'automatic', jsxImportSource: opts.jsxImportSource, }, + optimizeDeps: { esbuildOptions: { jsx: 'automatic' } }, } } },