import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import tailwindcss from "@tailwindcss/vite"; import tsconfigPaths from "vite-tsconfig-paths"; import { VitePWA } from "vite-plugin-pwa"; // https://vite.dev/config/ export default defineConfig({ plugins: [ react(), tailwindcss(), tsconfigPaths(), VitePWA({ registerType: "autoUpdate", devOptions: { enabled: false, // در حالت توسعه هم کار کند }, manifest: { name: "Danak Mail", short_name: "Danak Mail", description: "Danak Mail", theme_color: "#ffffff", background_color: "#ffffff", display: "standalone", start_url: "/received", // صفحه اصلی PWA icons: [ { src: "/16.png", sizes: "16x16", type: "image/png", }, { src: "/32.png", sizes: "32x32", type: "image/png", }, { src: "/48.png", sizes: "48x48", type: "image/png", }, { src: "/180.png", sizes: "118x118", type: "image/png", }, { src: "/192.png", sizes: "192x192", type: "image/png", }, { src: "/512.png", sizes: "512x512", type: "image/png", }, ], }, // workbox: { // maximumFileSizeToCacheInBytes: 4 * 1024 * 1024, // افزایش به 4MB // runtimeCaching: [ // { // urlPattern: /^https:\/\/admin-panel\.danakcorp\.com\//, // handler: "NetworkFirst", // options: { // cacheName: "api-cache", // expiration: { // maxEntries: 50, // maxAgeSeconds: 60 * 60 * 24, // }, // networkTimeoutSeconds: 10, // }, // }, // ], // }, }), ], });