Add PWA support using vite-plugin-pwa

Integrated the vite-plugin-pwa to enable Progressive Web App functionality. Added service worker registration, manifest configuration, and necessary assets like icons and favicon. This enhances offline capabilities and user experience.
This commit is contained in:
2026-02-03 13:35:52 +01:00
parent 52e1d5f0f8
commit 6cf7bf506a
5 changed files with 33 additions and 2 deletions

View File

@@ -1,6 +1,34 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { VitePWA } from "vite-plugin-pwa";
export default defineConfig({
plugins: [react()],
plugins: [
react(),
VitePWA({
registerType: "autoUpdate",
includeAssets: [
"favicon.ico",
"icons/icon-512.png",
"marauders-map.jpg" // oder dein Hintergrund
],
manifest: {
name: "Zauber-Detektiv Notizbogen",
short_name: "Notizbogen",
description: "Cluedo-Magie Sheet",
start_url: "/",
scope: "/",
display: "standalone",
background_color: "#1c140d",
theme_color: "#caa45a",
icons: [
{ src: "/icons/icon-512.png", sizes: "512x512", type: "image/png" }
]
},
workbox: {
// Caching-Default: die App-Shell wird offline verfügbar
globPatterns: ["**/*.{js,css,html,ico,png,jpg,jpeg,svg,webp}"],
}
})
]
});