import { defineConfig } from 'astro/config'; import sitemap from '@astrojs/sitemap'; import AstroPWA from '@vite-pwa/astro'; import tailwindcss from '@tailwindcss/vite'; export default defineConfig({ site: 'https://asger.xn--weirse-fya.dk', trailingSlash: 'ignore', integrations: [ sitemap({ changefreq: 'weekly', priority: 0.7, serialize(item) { if (item.url === 'https://asger.xn--weirse-fya.dk/') item.priority = 1.0; return item; }, }), // Service worker → offline support + installable PWA. autoUpdate + outdated-cache // cleanup so a redeploy never strands a visitor on a stale version. Reuses the // existing public/site.webmanifest (manifest: false = don't generate another). AstroPWA({ registerType: 'autoUpdate', manifest: false, includeManifestIcons: false, workbox: { globPatterns: ['**/*.{html,css,js,svg,png,woff2,xml,txt,webmanifest}'], cleanupOutdatedCaches: true, clientsClaim: true, skipWaiting: true, }, devOptions: { enabled: false }, }), ], prefetch: { prefetchAll: true, defaultStrategy: 'viewport' }, vite: { plugins: [tailwindcss()] }, });