67 lines
1.5 KiB
TypeScript
67 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: "AGW",
|
|
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,wasm}"],
|
|
maximumFileSizeToCacheInBytes: 10 * 1024 * 1024,
|
|
},
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@": resolve(__dirname, "src"),
|
|
},
|
|
},
|
|
build: {
|
|
outDir: "dist",
|
|
emptyOutDir: true,
|
|
},
|
|
})
|