all repos — emchess @ 582b0387fa0b9b6f7b51a8a13c4fee17764ffb39

vite.config.ts (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
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,
      },
      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" }],
      },
    }),
  ],
});