-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
66 lines (54 loc) · 1.59 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
import { createRequire } from 'node:module'
import { mergeConfig } from 'vite'
import {
createConfig,
IS_DEV_MODE,
BACKEND_URL,
GQL_SERVER_URL,
IS_PROD_BACKEND,
} from 'san-webkit-next/vite.config.js'
import { VERSION } from './version.js'
global.require = createRequire(import.meta.url)
process.env.MEDIA_PATH = '/webkit'
process.env.ICONS_PATH = process.env.MEDIA_PATH + '/icons'
console.log('VERSION -> ', JSON.stringify(VERSION))
console.log('BACKEND_URL -> ', JSON.stringify(BACKEND_URL))
console.log('GQL_SERVER_URL -> ', JSON.stringify(GQL_SERVER_URL))
console.log('IS_PROD_MODE -> ', !IS_DEV_MODE)
console.log('IS_PROD_BACKEND -> ', IS_PROD_BACKEND)
const config = mergeConfig(
createConfig({
corsOrigin: process.env.NODE_GQL_SERVER_URL,
}),
{
clientDefines: {
'process.browser': true,
},
serverDefines: {
'process.env.GQL_SERVER_URL': JSON.stringify(
process.env.NODE_GQL_SERVER_URL || GQL_SERVER_URL,
),
},
optimizeDeps: {
exclude: ['canvas'],
},
ssr: {
noExternal: [
'@santiment-network/chart',
'chart.js',
'Sanbase',
'san-queries',
// 'san-studio'
],
},
define: {
'process.browser': false,
'process.env.MEDIA_PATH': JSON.stringify(process.env.MEDIA_PATH),
'process.env.ICONS_PATH': JSON.stringify(process.env.ICONS_PATH),
'process.env.API_FETCH_ORIGIN': JSON.stringify('https://app.santiment.net'),
'process.env.SANBASE_ORIGIN': JSON.stringify(''),
'process.env.VERSION': JSON.stringify(VERSION),
},
},
)
export default config