import vue from "@astrojs/vue"; import tailwindcss from "@tailwindcss/vite"; import AstroPWA from "@vite-pwa/astro"; import { defineConfig } from "astro/config"; // https://astro.build/config export default defineConfig({ output: "static", integrations: [ vue(), AstroPWA({ registerType: "prompt", includeAssets: ["favicon.svg", "favicon.ico", "logo.svg", "icons/*.png", "backgrounds/*.svg"], manifest: { name: "Hmmm", short_name: "Hmmm", description: "Frame your quotes as shareable images. No account required.", theme_color: "#ffffff", background_color: "#ffffff", display: "standalone", orientation: "any", start_url: "/", scope: "/", lang: "en", categories: ["productivity", "photo", "utilities"], icons: [ { src: "icons/icon-192.png", sizes: "192x192", type: "image/png", purpose: "any", }, { src: "icons/icon-512.png", sizes: "512x512", type: "image/png", purpose: "any", }, { src: "icons/icon-maskable-192.png", sizes: "192x192", type: "image/png", purpose: "maskable", }, { src: "icons/icon-maskable-512.png", sizes: "512x512", type: "image/png", purpose: "maskable", }, ], }, workbox: { // App shell + assets; gallery SVGs are small — precache all globPatterns: ["**/*.{js,css,html,ico,svg,png,webp,woff,woff2,webmanifest}"], navigateFallback: "/index.html", navigateFallbackDenylist: [/^\/api/], runtimeCaching: [ { urlPattern: ({ request }) => request.destination === "font", handler: "CacheFirst", options: { cacheName: "hmmm-fonts", expiration: { maxEntries: 32, maxAgeSeconds: 60 * 60 * 24 * 365, }, }, }, { urlPattern: ({ url }) => url.pathname.startsWith("/backgrounds/"), handler: "CacheFirst", options: { cacheName: "hmmm-backgrounds", expiration: { maxEntries: 40, maxAgeSeconds: 60 * 60 * 24 * 90, }, }, }, ], }, devOptions: { enabled: false, }, }), ], vite: { plugins: [tailwindcss()], }, });