anydrop/web/vite.config.ts
ordinarthur 0034e91672
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 37s
feat: push notifications + iOS share sheet integration
- Web Push API for offline device notifications (VAPID)
- Custom service worker with push + share target handlers
- iOS/Android share sheet support via Web Share Target API
- Dedicated /share page with one-tap send to nearby peer
- Background tab notifications for incoming transfers
- Persistent deviceId per device
2026-04-14 12:05:59 +02:00

71 lines
1.7 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({
strategies: "injectManifest",
srcDir: "src",
filename: "sw.ts",
registerType: "autoUpdate",
includeAssets: ["favicon.svg"],
injectManifest: {
globPatterns: ["**/*.{js,css,html,ico,png,svg,woff2}"],
},
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",
},
],
share_target: {
action: "/share",
method: "POST",
enctype: "multipart/form-data",
params: {
title: "title",
text: "text",
url: "url",
files: [
{
name: "files",
accept: ["*/*"],
},
],
},
} as any,
},
devOptions: {
enabled: false,
},
}),
],
server: {
port: 5173,
host: true,
},
});