-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
68 lines (67 loc) · 2.22 KB
/
vite.config.ts
File metadata and controls
68 lines (67 loc) · 2.22 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
61
62
63
64
65
66
67
68
import { defineConfig } from 'vite';
import { sveltekit } from '@sveltejs/kit/vite';
import tailwindcss from '@tailwindcss/vite';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
plugins: [
tailwindcss(),
sveltekit(),
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.svg', 'icon.svg'],
manifest: {
name: 'Concept Visualizer',
short_name: 'ConceptViz',
description: 'Extract and visualize concepts and relationships from text.',
theme_color: '#3b82f6',
background_color: '#f9fafb',
display: 'standalone',
icons: [
{ src: 'favicon.svg', sizes: 'any', type: 'image/svg+xml' },
{ src: 'icon.svg', sizes: 'any', type: 'image/svg+xml', purpose: 'maskable' }
]
},
workbox: {
maximumFileSizeToCacheInBytes: 3 * 1024 * 1024, // 3 MiB — PlayCanvas chunk exceeds default 2 MiB
globPatterns: ['**/*.{js,css,html,svg,woff2}'],
runtimeCaching: [
{
urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'google-fonts-stylesheet',
expiration: { maxEntries: 4, maxAgeSeconds: 60 * 60 * 24 * 365 },
cacheableResponse: { statuses: [0, 200] }
}
},
{
urlPattern: /^https:\/\/fonts\.gstatic\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'google-fonts-files',
expiration: { maxEntries: 8, maxAgeSeconds: 60 * 60 * 24 * 365 },
cacheableResponse: { statuses: [0, 200] }
}
},
{
urlPattern: /^https:\/\/storage\.googleapis\.com\/tfjs-models\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'tfjs-model',
expiration: { maxEntries: 5, maxAgeSeconds: 60 * 60 * 24 * 30 },
cacheableResponse: { statuses: [0, 200] }
}
}
]
}
})
],
build: {
chunkSizeWarningLimit: 2000
},
test: {
include: ['src/**/*.test.ts'],
setupFiles: ['vitest.setup.ts'],
environment: 'jsdom'
}
});