JEISA-WEBAPP/vite.config.ts
davidels1 796bac47b4 Add icon generation script and new icons for PWA and favicons
- Introduced `generate-icons.mjs` script to automate the creation of PWA icons and favicons from the provided SVG logo.
- Generated icons include:
  - PWA icons: 192x192 and 512x512
  - Maskable icon with 12% padding: 512x512
  - Favicons: 32x32, 16x16
  - Apple-touch icon: 180x180
- Added a new PNG file for the maskable icon.
2025-09-25 00:50:36 +02:00

50 lines
1.4 KiB
TypeScript

import { defineConfig } from "vite";
import { VitePWA } from "vite-plugin-pwa";
import dyadComponentTagger from "@dyad-sh/react-vite-component-tagger";
import react from "@vitejs/plugin-react-swc";
import path from "path";
export default defineConfig(() => ({
server: {
host: "::",
port: 8080,
},
plugins: [
dyadComponentTagger(),
react(),
VitePWA({
registerType: "autoUpdate",
includeAssets: [
"favicon.ico",
"favicon-16x16.png",
"favicon-32x32.png",
"apple-touch-icon-180x180.png",
"robots.txt"
],
manifest: {
name: "JEI Stock App",
short_name: "JEI Stock",
description: "Stock management PWA for JEISA",
theme_color: "#0f172a",
background_color: "#ffffff",
display: "standalone",
scope: "/",
start_url: "/",
icons: [
{ src: "/icons/icon-192x192.png", sizes: "192x192", type: "image/png", purpose: "any" },
{ src: "/icons/icon-512x512.png", sizes: "512x512", type: "image/png", purpose: "any" },
{ src: "/icons/maskable-512x512.png", sizes: "512x512", type: "image/png", purpose: "maskable" }
],
},
workbox: {
navigateFallback: "/index.html",
cleanupOutdatedCaches: true,
},
}),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
}));