diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 82d49ec..751bf24 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -3,5 +3,8 @@ labels: ["dependencies"], rangeStrategy: "bump", packageRules: [{ depTypeList: ["peerDependencies"], enabled: false }], - ignoreDeps: ["generouted"] + ignoreDeps: [ + "generouted", // testing lib shipping JSX (new version ship transpiled JS) + "prettier", // waiting for stable choice on ternaries + ], } diff --git a/CHANGELOG.md b/CHANGELOG.md index a5f8c21..090d052 100644 --- a/CHANGELOG.md +++ b/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. + ## 3.4.1 ### Add support for `.mts` (fixes [#161](https://github.com/vitejs/vite-plugin-react-swc/issues/161)) diff --git a/src/index.ts b/src/index.ts index 5a5f851..34408cb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -83,6 +83,7 @@ const react = (_options?: Options): PluginOption[] => { esbuild: false, optimizeDeps: { include: [`${options.jsxImportSource}/jsx-dev-runtime`], + esbuildOptions: { jsx: "automatic" }, }, }), configResolved(config) {