From f0469417255674b9872480493953674965c5ba99 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Fri, 27 Jun 2025 10:18:42 +0200 Subject: Set static build by default and fix react workaround --- astro.config.mjs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'astro.config.mjs') diff --git a/astro.config.mjs b/astro.config.mjs index cc75542..03d6a57 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -6,17 +6,25 @@ import cloudflare from '@astrojs/cloudflare'; // https://astro.build/config export default defineConfig({ - output: 'server', + output: 'static', adapter: cloudflare({ platformProxy: { enabled: true } }), 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()], devToolbar: { enabled: false, }, + }); \ No newline at end of file -- cgit v1.3.1