import { fileURLToPath } from 'node:url';

import tailwindcss from '@tailwindcss/vite';
import icon from 'astro-icon';
import { defineConfig } from 'astro/config';

const publicSiteUrl = process.env.PUBLIC_SITE_URL ?? 'https://tenantatlas.example';

export default defineConfig({
    integrations: [icon()],
    output: 'static',
    site: publicSiteUrl,
    server: {
        host: true,
        port: 4321,
    },
    vite: {
        plugins: [tailwindcss()],
        resolve: {
            alias: {
                '@': fileURLToPath(new URL('./src', import.meta.url)),
            },
        },
    },
});
