75 lines
1.9 KiB
TypeScript
75 lines
1.9 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react-swc";
|
|
import path from "path";
|
|
import { componentTagger } from "lovable-tagger";
|
|
import { VitePWA } from "vite-plugin-pwa";
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig(({ mode }) => ({
|
|
server: {
|
|
host: "::",
|
|
port: 8080,
|
|
},
|
|
plugins: [
|
|
react(),
|
|
mode === "development" && componentTagger(),
|
|
VitePWA({
|
|
registerType: "autoUpdate",
|
|
devOptions: {
|
|
enabled: true,
|
|
type: 'classic'
|
|
},
|
|
includeAssets: ["favicon.ico", "robots.txt"],
|
|
manifest: {
|
|
name: "Status Monitor",
|
|
short_name: "StatusMon",
|
|
description: "Surveillance en temps réel de vos services et applications",
|
|
theme_color: "#0a0a0b",
|
|
background_color: "#0a0a0b",
|
|
display: "standalone",
|
|
orientation: "portrait",
|
|
start_url: "/",
|
|
icons: [
|
|
{
|
|
src: "/pwa-192x192.png",
|
|
sizes: "192x192",
|
|
type: "image/png",
|
|
},
|
|
{
|
|
src: "/pwa-512x512.png",
|
|
sizes: "512x512",
|
|
type: "image/png",
|
|
},
|
|
{
|
|
src: "/pwa-512x512.png",
|
|
sizes: "512x512",
|
|
type: "image/png",
|
|
purpose: "maskable",
|
|
},
|
|
],
|
|
},
|
|
workbox: {
|
|
globPatterns: ["**/*.{js,css,html,ico,png,svg,woff2}"],
|
|
runtimeCaching: [
|
|
{
|
|
urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
|
|
handler: "CacheFirst",
|
|
options: {
|
|
cacheName: "google-fonts-cache",
|
|
expiration: {
|
|
maxEntries: 10,
|
|
maxAgeSeconds: 60 * 60 * 24 * 365,
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
}),
|
|
].filter(Boolean),
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
}));
|