summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--astro.config.mjs9
1 files changed, 8 insertions, 1 deletions
diff --git a/astro.config.mjs b/astro.config.mjs
index de70194..93f58d9 100644
--- a/astro.config.mjs
+++ b/astro.config.mjs
@@ -10,7 +10,14 @@ import cloudflare from '@astrojs/cloudflare';
// https://astro.build/config
export default defineConfig({
vite: {
- plugins: [tailwindcss()]
+ plugins: [tailwindcss()],
+ resolve: {
+ // Use react-dom/server.edge instead of react-dom/server.browser for React 19.
+ // Without this, MessageChannel from node:worker_threads needs to be polyfilled.
+ alias: import.meta.env.PROD ? {
+ "react-dom/server": "react-dom/server.edge",
+ } : undefined,
+ },
},
integrations: [react()],