-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.ts
More file actions
75 lines (74 loc) · 1.79 KB
/
vite.config.ts
File metadata and controls
75 lines (74 loc) · 1.79 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
69
70
71
72
73
74
75
import { defineConfig } from 'vite';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
plugins: [
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.ico', 'robots.txt'],
manifest: {
name: 'Solarpunk Utopia Platform',
short_name: 'Solarpunk',
description: 'Community-based resource sharing and mutual aid platform',
theme_color: '#2D5016',
background_color: '#F4F1E8',
display: 'standalone',
orientation: 'portrait',
icons: [
{
src: '/icon-192.png',
sizes: '192x192',
type: 'image/png'
},
{
src: '/icon-512.png',
sizes: '512x512',
type: 'image/png'
}
]
},
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'],
runtimeCaching: [
{
urlPattern: /^https:\/\/.*\.(png|jpg|jpeg|svg|gif)$/,
handler: 'CacheFirst',
options: {
cacheName: 'images-cache',
expiration: {
maxEntries: 100,
maxAgeSeconds: 60 * 60 * 24 * 30 // 30 days
}
}
}
]
}
})
],
optimizeDeps: {
include: [
'@noble/hashes/utils',
'@noble/curves/ed25519',
'@noble/ed25519',
'@scure/bip39'
],
esbuildOptions: {
target: 'es2020'
}
},
build: {
target: 'es2020',
outDir: 'dist',
minify: 'terser',
sourcemap: true
},
server: {
port: 3000
},
test: {
environment: 'happy-dom',
include: ['src/**/*.test.ts', 'src/**/*.test.tsx'],
exclude: ['OpenSpec/**/*.test.ts', 'node_modules/**'],
globals: true,
setupFiles: ['./src/test-setup.ts'],
}
});