feat(frontend): add installable PWA support and refresh app icons (#195)

This commit is contained in:
sagit
2026-02-23 14:26:29 +08:00
committed by GitHub
parent daf34d0f6c
commit 98c463c62b
10 changed files with 53 additions and 2 deletions
+42 -1
View File
@@ -2,9 +2,50 @@ import path from "path";
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",
injectRegister: "auto",
includeAssets: ["favicon.ico", "apple-touch-icon.png"],
manifest: {
name: "FLVX",
short_name: "FLVX",
description: "FLVX forwarding management panel",
theme_color: "#2563eb",
background_color: "#f6f7fb",
display: "standalone",
start_url: "/",
scope: "/",
icons: [
{
src: "pwa-192x192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "pwa-512x512.png",
sizes: "512x512",
type: "image/png",
},
{
src: "pwa-maskable-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "maskable",
},
],
},
workbox: {
navigateFallback: "/index.html",
cleanupOutdatedCaches: true,
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024,
},
}),
],
base: "/",
resolve: {
alias: {