anydrop/web/vite.config.ts
ordinarthur d8d747276a
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 37s
fix: gate signaling behind profile setup, fix SW cache
2026-04-14 11:55:51 +02:00

57 lines
1.3 KiB
TypeScript

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { VitePWA } from "vite-plugin-pwa";
import { nodePolyfills } from "vite-plugin-node-polyfills";
export default defineConfig({
define: {
global: "globalThis",
},
plugins: [
react(),
nodePolyfills({
include: ["process", "events", "stream", "buffer", "util"],
}),
VitePWA({
registerType: "autoUpdate",
includeAssets: ["favicon.svg"],
workbox: {
skipWaiting: true,
clientsClaim: true,
navigateFallback: "index.html",
runtimeCaching: [
{
urlPattern: ({ request }) => request.mode === "navigate",
handler: "NetworkFirst",
},
],
},
manifest: {
name: "AnyDrop",
short_name: "AnyDrop",
description: "Partage de fichiers instantané, peer-to-peer, sans compte",
theme_color: "#6366f1",
background_color: "#0f172a",
display: "standalone",
start_url: "/",
icons: [
{
src: "/icon-192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "/icon-512.png",
sizes: "512x512",
type: "image/png",
},
],
},
}),
],
server: {
port: 5173,
host: true,
},
});