-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
60 lines (59 loc) · 1.69 KB
/
Copy pathvite.config.ts
File metadata and controls
60 lines (59 loc) · 1.69 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
plugins: [
svelte(),
VitePWA({
// Pitfall B-1: do NOT auto-update; SW reload mid-survey kills draft session.
// 'prompt' surfaces an update banner the user can defer until after the survey.
registerType: 'prompt',
injectRegister: 'auto',
includeAssets: ['practice.json', 'icons/*.png'],
workbox: {
cleanupOutdatedCaches: true,
globPatterns: ['**/*.{js,css,html,svg,png,ico,webmanifest,json}'],
// Never proxy IndexedDB or fetch the practice.json from cache (allow per-request override)
navigateFallbackDenylist: [/^\/api/],
},
manifest: {
name: 'vqol. VEINES-QOL/Sym tracker',
short_name: 'vqol',
description:
'Patient-owned VEINES-QOL/Sym tracker. Local-only, no telemetry, MIT-licensed.',
theme_color: '#2a5a8a',
background_color: '#ffffff',
display: 'standalone',
start_url: './',
scope: './',
icons: [
{
src: 'icons/icon-192.png',
sizes: '192x192',
type: 'image/png',
purpose: 'any maskable',
},
{
src: 'icons/icon-512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any maskable',
},
],
},
devOptions: {
enabled: false,
},
}),
],
base: './',
build: {
target: 'es2022',
sourcemap: true,
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./vitest.setup.ts'],
},
});