-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
40 lines (39 loc) · 1.07 KB
/
vite.config.ts
File metadata and controls
40 lines (39 loc) · 1.07 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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { VitePWA } from 'vite-plugin-pwa'
import { CommitHashPlugin } from 'vite-plugin-commit-hash';
export default defineConfig({
plugins: [
react(),
CommitHashPlugin(),
VitePWA({
registerType: 'autoUpdate',
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
globIgnores: ['**/buttplug_wasm-*.js', '**/wasm/**', '**/wasm-worker.js'],
runtimeCaching: [{
urlPattern: /\/wasm\/.*/,
handler: 'CacheFirst',
options: {
cacheName: 'wasm-assets',
expiration: {
maxEntries: 10,
maxAgeSeconds: 30 * 24 * 60 * 60
},
cacheableResponse: {
statuses: [0, 200]
}
}
}]
},
manifest: {
theme_color: '#000000'
}
})
],
test: {
globals: true,
environment: 'jsdom',
setupFiles: './src/setupTests.ts', // Optional: if you have setup files
},
})