23 lines
757 B
JavaScript
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()]
|
|
}
|
|
}); |