-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
82 lines (78 loc) · 2.27 KB
/
vite.config.ts
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
78
79
80
81
82
import react from '@vitejs/plugin-react-swc';
import { defineConfig } from 'vite';
import { VitePWA } from 'vite-plugin-pwa';
import tsconfigPaths from 'vite-tsconfig-paths';
export default defineConfig(() => {
return {
build: {
outDir: 'build',
},
define: {
'process.env': process.env,
},
plugins: [
tsconfigPaths(),
react(),
VitePWA({
workbox: {
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024, // 5 MB
},
registerType: 'autoUpdate',
includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'mask-icon.svg'],
manifest: {
name: 'Aura',
short_name: 'aura',
description: 'Aura web app',
theme_color: '#0c0a09',
icons: [
{
src: '/assets/images/pwa/aura-image-256x256.png',
sizes: '256x256',
type: 'image/png',
purpose: 'any maskable',
},
{
src: '/assets/images/pwa/aura-image-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: '/assets/images/pwa/aura-image-512x512.png',
sizes: '512x512',
type: 'image/png',
},
{
src: '/assets/images/pwa/aura-image-256x256.png',
sizes: '256x256',
type: 'image/png',
},
],
},
}),
],
server: {
port: 3000,
proxy: {
'^/brightid(/.*)?$': {
target: 'https://recovery.brightid.org',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/brightid/, ''),
secure: process.env.NODE_ENV !== 'development',
},
'^/auranode(/.*)?$': {
target: 'https://aura-node.brightid.org',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/auranode/, ''),
secure: process.env.NODE_ENV !== 'development',
},
'^/auranode-test(/.*)?$': {
target: 'https://aura-test.brightid.org',
changeOrigin: true,
rewrite: (path) => path.replace(/auranode-test\//, ''),
secure: process.env.NODE_ENV !== 'development',
autoRewrite: true,
},
},
},
};
});