Skip to content

Commit cadd7d2

Browse files
authored
fix!: remove resolve.dedupe (#586)
1 parent 005f16e commit cadd7d2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

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+
### `react` and `react-dom` is no longer added to [`resolve.dedupe`](https://vite.dev/config/#resolve-dedupe) automatically
6+
7+
Adding values to `resolve.dedupe` forces Vite to resolve them differently from how Node.js does, which can be confusing and may not be expected. This plugin no longer adds `react` and `react-dom` to `resolve.dedupe` automatically.
8+
9+
If you encounter errors after upgrading, check your package.json for version mismatches in `dependencies` or `devDependencies`, as well as your package manager’s configuration. If you prefer the previous behavior, you can manually add `react` and `react-dom` to `resolve.dedupe`.
10+
511
### Remove old `babel-plugin-react-compiler` support that requires `runtimeModule` option
612

713
`runtimeModule` option is no longer needed in newer `babel-plugin-react-compiler` versions. Make sure to use a newer version of `babel-plugin-react-compiler` that supports `target` option.

packages/plugin-react/src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,6 @@ export default function viteReact(opts: Options = {}): Plugin[] {
358358
optimizeDeps: {
359359
include: dependencies,
360360
},
361-
resolve: {
362-
dedupe: ['react', 'react-dom'],
363-
},
364361
}),
365362
resolveId: {
366363
filter: { id: exactRegex(runtimePublicPath) },

0 commit comments

Comments
 (0)