import { defineConfig } from "vite"; import { VitePWA } from "vite-plugin-pwa"; export default defineConfig({ base: "./", build: { target: "es2020", assetsInlineLimit: 0, }, plugins: [ VitePWA({ registerType: "autoUpdate", workbox: { globPatterns: ["**/*.{js,css,html,wasm,woff,woff2,svg}"], // The Stockfish wasm is ~7MB, so raise the precache size limit. maximumFileSizeToCacheInBytes: 9 * 1024 * 1024, // Take over at once and drop old caches, so a bad old cache can't linger. skipWaiting: true, clientsClaim: true, cleanupOutdatedCaches: true, }, manifest: { name: "Emchess", short_name: "Emchess", description: "A small chess game with emoji pieces.", theme_color: "#f5f1e6", background_color: "#f5f1e6", display: "standalone", icons: [{ src: "icon.svg", sizes: "any", type: "image/svg+xml" }], }, }), ], });