Files
cloudflare-workers-and-pages[bot] d1ac06b636 Add Cloudflare Workers configuration (#5)
Co-authored-by: cloudflare-workers-and-pages[bot] <73139402+cloudflare-workers-and-pages[bot]@users.noreply.github.com>
2026-05-18 21:30:31 +02:00

23 lines
757 B
JavaScript

import node from '@astrojs/node';
import { defineConfig } from 'astro/config';
import react from '@astrojs/react';
import tailwindcss from '@tailwindcss/vite';
import cloudflare from "@astrojs/cloudflare";
const normalizeUrl = (value) => (value.endsWith('/') ? value : `${value}/`);
const rawSiteUrl = process.env.PUBLIC_SITE_URL || process.env.EXTERNAL_SITE_URL || 'https://electron-rare.github.io/';
const siteUrl = normalizeUrl(rawSiteUrl);
const sitePathname = new URL(siteUrl).pathname;
const basePath = sitePathname === '/' ? '/' : sitePathname.replace(/\/$/, '');
export default defineConfig({
site: siteUrl,
base: basePath,
output: 'server',
adapter: cloudflare(),
integrations: [react()],
vite: {
plugins: [tailwindcss()]
}
});