check service worker

This commit is contained in:
hamid zarghami
2025-07-27 12:14:43 +03:30
parent c9c2b87c21
commit 2a41bf528c
+45 -45
View File
@@ -2,7 +2,7 @@ import { defineConfig } from "vite";
import react from "@vitejs/plugin-react"; import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite"; import tailwindcss from "@tailwindcss/vite";
import tsconfigPaths from "vite-tsconfig-paths"; import tsconfigPaths from "vite-tsconfig-paths";
import { VitePWA } from "vite-plugin-pwa"; // import { VitePWA } from "vite-plugin-pwa";
// https://vite.dev/config/ // https://vite.dev/config/
export default defineConfig({ export default defineConfig({
@@ -10,49 +10,49 @@ export default defineConfig({
react(), react(),
tailwindcss(), tailwindcss(),
tsconfigPaths(), tsconfigPaths(),
VitePWA({ // VitePWA({
registerType: "autoUpdate", // registerType: "autoUpdate",
devOptions: { // devOptions: {
enabled: false, // در حالت توسعه هم کار کند // enabled: false, // در حالت توسعه هم کار کند
}, // },
manifest: { // manifest: {
name: "Danak Mail", // name: "Danak Mail",
short_name: "Danak Mail", // short_name: "Danak Mail",
description: "Danak Mail", // description: "Danak Mail",
theme_color: "#ffffff", // theme_color: "#ffffff",
background_color: "#ffffff", // background_color: "#ffffff",
display: "standalone", // display: "standalone",
start_url: "/received", // صفحه اصلی PWA // start_url: "/received", // صفحه اصلی PWA
icons: [ // icons: [
{ // {
src: "/icon-192x192.png", // src: "/icon-192x192.png",
sizes: "192x192", // sizes: "192x192",
type: "image/png", // type: "image/png",
}, // },
{ // {
src: "/icon-512x512.png", // src: "/icon-512x512.png",
sizes: "512x512", // sizes: "512x512",
type: "image/png", // type: "image/png",
}, // },
], // ],
}, // },
// workbox: { // // workbox: {
// maximumFileSizeToCacheInBytes: 4 * 1024 * 1024, // افزایش به 4MB // // maximumFileSizeToCacheInBytes: 4 * 1024 * 1024, // افزایش به 4MB
// runtimeCaching: [ // // runtimeCaching: [
// { // // {
// urlPattern: /^https:\/\/admin-panel\.danakcorp\.com\//, // // urlPattern: /^https:\/\/admin-panel\.danakcorp\.com\//,
// handler: "NetworkFirst", // // handler: "NetworkFirst",
// options: { // // options: {
// cacheName: "api-cache", // // cacheName: "api-cache",
// expiration: { // // expiration: {
// maxEntries: 50, // // maxEntries: 50,
// maxAgeSeconds: 60 * 60 * 24, // // maxAgeSeconds: 60 * 60 * 24,
// }, // // },
// networkTimeoutSeconds: 10, // // networkTimeoutSeconds: 10,
// }, // // },
// }, // // },
// ], // // ],
// }, // // },
}), // }),
], ],
}); });