-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvite.config.ts
More file actions
77 lines (76 loc) · 2.36 KB
/
vite.config.ts
File metadata and controls
77 lines (76 loc) · 2.36 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
76
77
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import wasm from 'vite-plugin-wasm';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
base: '/haze-wallet',
plugins: [
react(),
wasm(),
VitePWA({
registerType: 'autoUpdate',
manifest: {
name: 'Haze Wallet',
short_name: 'Wallet',
start_url: '/haze-wallet/',
display: 'standalone',
background_color: '#e5f1ffff',
theme_color: '#111827',
icons: [
{
src: '/haze-wallet/logo.png',
sizes: '192x192',
type: 'image/webp',
},
],
},
workbox: {
maximumFileSizeToCacheInBytes: 15 * 1024 * 1024,
runtimeCaching: [
{
urlPattern: ({ request }) => request.destination === 'document',
handler: 'NetworkFirst',
},
{
urlPattern: ({ request }) =>
request.destination === 'script' || request.destination === 'worker',
handler: 'CacheFirst',
},
{
urlPattern: /.*\.wasm$/,
handler: 'CacheFirst',
},
],
},
}),
],
build: {
target: 'esnext',
rollupOptions: {
output: {
manualChunks: {
fedimint: ['@fedimint/core-web'],
ndk: [
'@nostr-dev-kit/ndk',
'@nostr-dev-kit/ndk-cache-dexie',
'nostr-tools',
'@noble/hashes',
],
bitcoin: [
'@mempool/mempool.js',
'@scure/bip32',
'@scure/bip39',
'bitcoin-address-validation',
],
},
},
},
},
worker: {
format: 'es',
plugins: () => [wasm()],
},
optimizeDeps: {
exclude: ['@fedimint/core-web'],
},
});