summaryrefslogtreecommitdiff
path: root/astro.config.mjs
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2025-06-27 10:18:42 +0200
committerYuval Adam <_@yuv.al>2025-06-27 10:18:42 +0200
commitf0469417255674b9872480493953674965c5ba99 (patch)
tree37d8811fa399dde5da902c624987f4c78b93d29a /astro.config.mjs
parent2ad5ce929f6d69c9aaca71573744b30e02ab8bed (diff)
Set static build by default and fix react workaround
Diffstat (limited to 'astro.config.mjs')
-rw-r--r--astro.config.mjs12
1 files changed, 10 insertions, 2 deletions
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