mirror of
https://github.com/davila7/claude-code-templates.git
synced 2026-09-19 01:30:23 +08:00
dc4161b9f1
- PUBLIC_CLERK_PUBLISHABLE_KEY, PUBLIC_COMPONENTS_JSON_URL, PUBLIC_GITHUB_CLIENT_ID moved from Cloudflare secrets to [vars] so Vite embeds them at build time - react-dom/server.node alias and noExternal now only apply during build (fixes 'require is not defined' error in local dev)
38 lines
961 B
JavaScript
38 lines
961 B
JavaScript
import { defineConfig } from 'astro/config';
|
|
import react from '@astrojs/react';
|
|
import cloudflare from '@astrojs/cloudflare';
|
|
import tailwindcss from '@tailwindcss/vite';
|
|
|
|
export default defineConfig({
|
|
site: 'https://www.aitmpl.com',
|
|
output: 'server',
|
|
adapter: cloudflare({ mode: 'directory' }),
|
|
integrations: [react()],
|
|
vite: {
|
|
plugins: [
|
|
tailwindcss(),
|
|
{
|
|
name: 'cloudflare-react-dom-server',
|
|
config(_config, { command }) {
|
|
if (command === 'build') {
|
|
return {
|
|
resolve: {
|
|
alias: [
|
|
{ find: /^react-dom\/server$/, replacement: 'react-dom/server.node' },
|
|
],
|
|
},
|
|
ssr: { noExternal: ['react-dom'] },
|
|
};
|
|
}
|
|
},
|
|
},
|
|
],
|
|
resolve: {
|
|
dedupe: ['react', 'react-dom'],
|
|
},
|
|
ssr: {
|
|
external: ['node:fs', 'node:path', 'node:url', 'node:stream'],
|
|
},
|
|
},
|
|
});
|