Files
sokoban/vite/config.prod.mjs
T
tiennm99 dff4ea9eab fix: address review-pass findings
- GameView: ignore game keys (Esc/R/U/Z) while the donate modal is open
  so its own Escape no longer doubles as a navigate-to-levels.
- GameView: tag the win dialog with role/aria-modal/aria-labelledby so
  screen readers announce it correctly.
- LevelSelectView: read the progress snapshot once per page render
  instead of two localStorage parses per visible tile (40 reads -> 1).
- progress-store: add snapshot() method for batch reads.
- vite-plugin-pwa: include jpg in the workbox precache glob so the
  donation QR keeps working offline.
2026-04-27 20:51:37 +07:00

35 lines
1.3 KiB
JavaScript

import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
base: '/sokoban/',
plugins: [
svelte(),
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.png', 'apple-touch-icon.png'],
manifest: {
name: 'Sokoban',
short_name: 'Sokoban',
description: 'Microban Sokoban puzzles, Svelte edition',
start_url: '/sokoban/',
scope: '/sokoban/',
display: 'standalone',
orientation: 'any',
background_color: '#2e3440',
theme_color: '#5e81ac',
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' }
]
},
workbox: {
// jpg is needed so the donation QR image works offline.
globPatterns: ['**/*.{js,css,html,png,jpg,svg,webmanifest}']
}
})
]
});