-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.js
47 lines (43 loc) · 1.42 KB
/
vite.config.js
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
import { resolve } from 'path'
import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import basicSsl from '@vitejs/plugin-basic-ssl'
process.env.GQL_SERVER_URL = 'https://api-stage.santiment.net/graphql'
process.env.IS_DEV_MODE = process.env.NODE_ENV !== 'production'
process.env.MEDIA_PATH = '/node_modules/san-webkit/lib'
process.env.ICONS_PATH = '/node_modules/san-webkit/lib/icons'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [process.env.IS_DEV_MODE && process.argv.includes('--https') && basicSsl(), svelte()],
resolve: {
alias: [
{
find: '@',
replacement: '/src',
},
{
find: 'san-chart',
replacement: '/node_modules/@santiment-network/chart/',
},
{ find: 'webkit', replacement: __dirname + '/node_modules/san-webkit/lib/' },
{ find: 'san-webkit', replacement: __dirname + '/node_modules/san-webkit/' },
{ find: 'air-datepicker', replacement: __dirname + '/node_modules/air-datepicker/' },
],
},
define: {
'process.browser': true,
'process.env': process.env,
'process.env.IS_DEV_MODE': process.env.IS_DEV_MODE,
},
optimizeDeps: {
exclude: ['webkit', 'san-webkit', 'canvas', 'node-fetch'],
},
build: {
rollupOptions: {
input: {
index: resolve(__dirname, 'index.html'),
chart: resolve(__dirname, 'chart/index.html'),
},
},
},
})