File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
code/lib/react-dom-shim/src Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,20 @@ export const webpackFinal = async (config: any, options: Options) => {
5050
5151export const viteFinal = async ( config : any , options : Options ) => {
5252 const isReactVersion18 = await getIsReactVersion18or19 ( options ) ;
53+
54+ const optimizeDeps = {
55+ ...( config ?. optimizeDeps ?? { } ) ,
56+ include : [
57+ ...( config . optimizeDeps ?. include || [ ] ) ,
58+ ...( isReactVersion18 ? [ 'react-dom/client' ] : [ ] ) ,
59+ ] ,
60+ } ;
61+
5362 if ( isReactVersion18 ) {
54- return config ;
63+ return {
64+ ...config ,
65+ optimizeDeps,
66+ } ;
5567 }
5668
5769 const alias = Array . isArray ( config . resolve ?. alias )
@@ -66,13 +78,7 @@ export const viteFinal = async (config: any, options: Options) => {
6678
6779 return {
6880 ...config ,
69- optimizeDeps : {
70- ...( config ?. optimizeDeps ?? { } ) ,
71- include : [
72- ...( config . optimizeDeps ?. include || [ ] ) ,
73- ...( isReactVersion18 ? [ 'react-dom/client' ] : [ ] ) ,
74- ] ,
75- } ,
81+ optimizeDeps,
7682 resolve : {
7783 ...config . resolve ,
7884 alias,
You can’t perform that action at this time.
0 commit comments