mirror of
https://github.com/Lissy93/awesome-privacy.git
synced 2026-03-11 08:55:33 +00:00
57 lines
1.4 KiB
JavaScript
57 lines
1.4 KiB
JavaScript
import { defineConfig } from 'astro/config';
|
|
|
|
// Integrations
|
|
import svelte from '@astrojs/svelte';
|
|
import partytown from '@astrojs/partytown';
|
|
import sitemap from '@astrojs/sitemap';
|
|
import { printSummary } from './src/utils/logger.ts';
|
|
|
|
// Adapters
|
|
import vercelAdapter from '@astrojs/vercel/serverless';
|
|
import netlifyAdapter from '@astrojs/netlify';
|
|
import nodeAdapter from '@astrojs/node';
|
|
import cloudflareAdapter from '@astrojs/cloudflare';
|
|
|
|
// Determine the deploy target (vercel, netlify, cloudflare, node)
|
|
const deployTarget = import.meta.env.DEPLOY_TARGET || 'vercel';
|
|
|
|
// Determine the output mode (server or hybrid)
|
|
const output = import.meta.env.OUTPUT || 'hybrid';
|
|
|
|
// The FQDN of where the site is hosted (used for sitemaps & canonical URLs)
|
|
const site = import.meta.env.SITE_URL || 'https://awesome-privacy.xyz';
|
|
|
|
// Initialize Astro integrations
|
|
const buildLogger = {
|
|
name: 'build-logger',
|
|
hooks: {
|
|
'astro:build:done': () => printSummary(),
|
|
},
|
|
};
|
|
|
|
const integrations = [svelte(), partytown(), sitemap(), buildLogger];
|
|
|
|
// Set the appropriate adapter, based on the deploy target
|
|
const adapter = {
|
|
vercel: vercelAdapter,
|
|
netlify: netlifyAdapter,
|
|
cloudflare: cloudflareAdapter,
|
|
node: nodeAdapter({
|
|
mode: 'standalone',
|
|
}),
|
|
}[deployTarget]();
|
|
|
|
// Export Astro configuration
|
|
export default defineConfig({
|
|
output,
|
|
integrations,
|
|
site,
|
|
adapter,
|
|
vite: {
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: { api: 'modern' },
|
|
},
|
|
},
|
|
},
|
|
});
|