-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts
45 lines (40 loc) · 986 Bytes
/
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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { createHtmlPlugin } from 'vite-plugin-html'
import basicSsl from '@vitejs/plugin-basic-ssl'
import { resolve } from 'path';
import { RPC_ENDPOINT, WALLET_CONNECT_BRIDGE } from './src/config'
function getHtmlInjectParams() {
const rpcURL = new URL(RPC_ENDPOINT);
const rpcDomain = rpcURL.host;
const walletConnectURL = new URL(WALLET_CONNECT_BRIDGE);
const walletConnectDomain = walletConnectURL.host;
const connectSrc = [
rpcDomain,
`wss://*.${walletConnectDomain}`,
`wss://${walletConnectDomain}`,
].join(' ')
return { connectSrc };
}
export default defineConfig({
plugins: [
vue(),
basicSsl(),
createHtmlPlugin({
minify: true,
inject: {
data: getHtmlInjectParams(),
},
})
],
server: {
host: '0.0.0.0',
port: 31801,
https: true,
},
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
},
},
})