Try marking React 18’s react-dom/client as external

This commit is contained in:
delucis 2022-03-30 11:39:45 +02:00
parent 99513c3703
commit 2ea2a31db7
No known key found for this signature in database
GPG key ID: 52DB15DC07051619
2 changed files with 2 additions and 2 deletions

View file

@ -7,7 +7,7 @@ const usingReact18 = version.startsWith('18.');
// Import the correct hydration method based on the version of React.
const hydrateFn = (
async () => usingReact18
? (await import('react-dom/client')).hydrateRoot
? (await import('react-dom/client.js')).hydrateRoot
: (await import('react-dom')).hydrate
)();

View file

@ -36,7 +36,7 @@ function getViteConfiguration() {
dedupe: ['react', 'react-dom'],
},
ssr: {
external: ['react-dom/server.js'],
external: ['react-dom/server.js', 'react-dom/client.js'],
},
};
}