import tailwindcss from "@tailwindcss/vite"; import react from "@vitejs/plugin-react"; import { defineConfig } from "vite"; import { VitePWA } from "vite-plugin-pwa"; export default defineConfig({ plugins: [ react({ babel: { plugins: ["babel-plugin-react-compiler"] } }), tailwindcss(), VitePWA({ registerType: "autoUpdate", workbox: { globPatterns: ["**/*.{js,css,html,svg,png,woff2}"], // Don't cache API/WebSocket requests navigateFallbackDenylist: [/^\/api/, /^\/ws/], }, manifest: { name: "VoicePaste", short_name: "VoicePaste", description: "语音转文字,一键粘贴到电脑剪贴板", theme_color: "#08080d", background_color: "#08080d", display: "standalone", orientation: "portrait", scope: "/", 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", }, ], }, }), ], root: ".", build: { outDir: "dist", emptyOutDir: true, }, });