Files
electron-rare.github.io/astro.config.mjs
T
cloudflare-workers-and-pages[bot] dff1e3c76e Add Cloudflare Workers configuration
2026-04-28 13:37:31 +00: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()]
}
});