Files
pw/astro.config.mjs
T
Asger Geel WeirsøeandClaude Opus 4.8 cae3402d73
Build & Deploy / deploy (push) Successful in 1m32s
pwa: service worker for offline + installerbar (vite-pwa, autoUpdate)
@vite-pwa/astro genererer en Workbox-SW der precacher alt (59 entries); autoUpdate + skipWaiting + cleanupOutdatedCaches saa redeploy aldrig strander en bruger paa gammel version. Registrering injiceret via /registerSW.js i Base.astro (manifest:false bruger den eksisterende site.webmanifest). Offline-brug + Add-to-Home-Screen.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 21:53:00 +02:00

37 lines
1.2 KiB
JavaScript

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()] },
});