-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
43 lines (42 loc) · 1.43 KB
/
Copy pathvite.config.js
File metadata and controls
43 lines (42 loc) · 1.43 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig({
plugins: [
react(),
VitePWA({
registerType: 'prompt',
manifest: {
name: 'Emuste – DS Emulator',
short_name: 'Emuste',
description: 'Nintendo DS Emulator PWA avec sync cloud',
theme_color: '#7c3aed',
background_color: '#09090b',
display: 'standalone',
orientation: 'any',
icons: [
{ src: 'icons/icon-192.png', sizes: '192x192', type: 'image/png' },
{ src: 'icons/icon-512.png', sizes: '512x512', type: 'image/png', purpose: 'any maskable' }
]
},
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,wasm}'],
// L'iframe emulator.html?params ne doit JAMAIS recevoir index.html
// via le fallback SPA du service worker (sinon l'app se charge dans l'iframe)
navigateFallbackDenylist: [/emulator\.html/],
maximumFileSizeToCacheInBytes: 10 * 1024 * 1024,
runtimeCaching: [
{
urlPattern: /^https:\/\/cdn\.emulatorjs\.org\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'emulatorjs-cdn',
expiration: { maxEntries: 150, maxAgeSeconds: 7 * 24 * 60 * 60 },
cacheableResponse: { statuses: [0, 200] }
}
}
]
}
})
]
})