import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import { TanStackRouterVite } from "@tanstack/router-vite-plugin"; import { VitePWA } from "vite-plugin-pwa"; import path from "node:path"; export default defineConfig({ plugins: [ TanStackRouterVite(), react(), VitePWA({ registerType: "autoUpdate", includeAssets: ["favicon.ico", "icons/*.png"], manifest: { name: "ordinarthur-os", short_name: "ordinarthur", description: "Assistant personnel d'Arthur Barré", theme_color: "#F5F1EA", background_color: "#F5F1EA", display: "standalone", start_url: "/", icons: [ { src: "/icons/icon-192.png", sizes: "192x192", type: "image/png" }, { src: "/icons/icon-512.png", sizes: "512x512", type: "image/png" }, { src: "/icons/icon-maskable.png", sizes: "512x512", type: "image/png", purpose: "maskable" }, ], }, workbox: { // Phase 2 : ajouter stale-while-revalidate sur GET /api/* navigateFallback: "/index.html", }, }), ], resolve: { alias: { "@": path.resolve(__dirname, "src") }, }, server: { port: 5173, host: true }, });