Skip to content

Commit

Permalink
Remove react integration ssr.external config
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Jan 16, 2025
1 parent df90e6d commit e8b121d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/many-pianos-develop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/react': patch
---

Removes hardcoded `ssr.external: ['react-dom/server', 'react-dom/client']` config that causes issues with adapters that bundle all dependencies (e.g. Cloudflare). These externals should already be inferred by default by Vite when deploying to a server environment.
1 change: 0 additions & 1 deletion packages/integrations/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ function getViteConfiguration(
},
plugins: [react({ include, exclude, babel }), optionsPlugin(!!experimentalReactChildren)],
ssr: {
external: reactConfig.externals,
noExternal: [
// These are all needed to get mui to work.
'@mui/material',
Expand Down
3 changes: 0 additions & 3 deletions packages/integrations/react/src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@ export const versionsConfig = {
17: {
server: '@astrojs/react/server-v17.js',
client: '@astrojs/react/client-v17.js',
externals: ['react-dom/server.js', 'react-dom/client.js'],
},
18: {
server: '@astrojs/react/server.js',
client: '@astrojs/react/client.js',
externals: ['react-dom/server', 'react-dom/client'],
},
19: {
server: '@astrojs/react/server.js',
client: '@astrojs/react/client.js',
externals: ['react-dom/server', 'react-dom/client'],
},
};

0 comments on commit e8b121d

Please sign in to comment.