We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
react-dom
optimizeOps
1 parent 63b2e38 commit 0700d04Copy full SHA for 0700d04
packages/plugin-react/src/index.ts
@@ -268,10 +268,12 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
268
},
269
}
270
271
- // We can't add `react-dom` because the dependency is `react-dom/client`
272
- // for React 18 while it's `react-dom` for React 17. We'd need to detect
273
- // what React version the user has installed.
274
- const dependencies = ['react', jsxImportDevRuntime, jsxImportRuntime]
+ const dependencies = [
+ 'react',
+ 'react-dom',
+ jsxImportDevRuntime,
275
+ jsxImportRuntime,
276
+ ]
277
const staticBabelPlugins =
278
typeof opts.babel === 'object' ? opts.babel?.plugins ?? [] : []
279
if (hasCompilerWithDefaultRuntime(staticBabelPlugins)) {
0 commit comments