Files
agw/vite.config.ts
Felix Förtsch 4e3aa682ac abgeordnetenwatch PWA + backend
feature-based React PWA with Hono backend:
- feed from abgeordnetenwatch.de API (polls by topic + politician)
- follow topics, search and follow politicians
- geo-based politician discovery via Nominatim
- push notifications for new polls via web-push
- service worker with offline caching
- deploy to Uberspace 8 (systemd, PostgreSQL, web backend proxy)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 08:14:22 +01:00

66 lines
1.5 KiB
TypeScript

import { dirname, resolve } from "node:path"
import { fileURLToPath } from "node:url"
import tailwindcss from "@tailwindcss/vite"
import { tanstackRouter } from "@tanstack/router-plugin/vite"
import react from "@vitejs/plugin-react"
import { defineConfig } from "vite"
import { VitePWA } from "vite-plugin-pwa"
const __dirname = dirname(fileURLToPath(import.meta.url))
export default defineConfig({
base: "/agw/",
plugins: [
tanstackRouter({
routesDirectory: "src/routes",
generatedRouteTree: "src/routeTree.gen.ts",
}),
react(),
tailwindcss(),
VitePWA({
strategies: "injectManifest",
srcDir: "src",
filename: "sw.ts",
registerType: "prompt",
manifest: {
name: "Abgeordnetenwatch",
short_name: "Abgwatch",
description: "Track Bundestag and Landtag votes, follow topics and politicians.",
start_url: "/agw/",
scope: "/agw/",
display: "standalone",
orientation: "portrait-primary",
theme_color: "#1d4ed8",
background_color: "#f9fafb",
lang: "en",
icons: [
{
src: "/agw/icons/icon-192.png",
sizes: "192x192",
type: "image/png",
purpose: "any maskable",
},
{
src: "/agw/icons/icon-512.png",
sizes: "512x512",
type: "image/png",
purpose: "any maskable",
},
],
},
injectManifest: {
globPatterns: ["**/*.{js,css,html,svg,png,woff2}"],
},
}),
],
resolve: {
alias: {
"@": resolve(__dirname, "src"),
},
},
build: {
outDir: "dist",
emptyOutDir: true,
},
})