summaryrefslogtreecommitdiff
path: root/astro.config.mjs
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2025-07-20 09:25:57 +0200
committerYuval Adam <_@yuv.al>2025-07-20 09:26:38 +0200
commita7ee68537840c6929b52be076b70d14057efd9c5 (patch)
tree9a4a055c11c99d6e688fcecceb40047e2cc0f79d /astro.config.mjs
parentee1a980de69c2e82f06872d8edf023cd1e99feb6 (diff)
message channel workaround
Diffstat (limited to 'astro.config.mjs')
-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()],