-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.js
More file actions
46 lines (45 loc) · 1.29 KB
/
vite.config.js
File metadata and controls
46 lines (45 loc) · 1.29 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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js'
import dts from 'vite-plugin-dts'
export default defineConfig({
plugins: [react(), cssInjectedByJsPlugin(), dts()],
server: {
proxy: {
'/graphql': {
target: 'https://mainnet.intuition.sh',
changeOrigin: true,
rewrite: (path) => '/v1/graphql',
configure: (proxy, _options) => {
proxy.on('error', (err, _req, _res) => {
console.log('proxy error', err);
});
proxy.on('proxyReq', (_proxyReq, req, _res) => {
console.log('Sending Request:', req.method, req.url);
});
proxy.on('proxyRes', (proxyRes, req, _res) => {
console.log('Received Response:', proxyRes.statusCode, req.url);
});
}
}
}
},
build: {
lib: {
entry: 'src/index.tsx',
name: 'PlayerMap',
fileName: (format) => `index.${format}.js`
},
rollupOptions: {
external: ['react', 'react-dom', 'aframe', '3d-force-graph-vr'],
output: {
globals: {
'react': 'React',
'react-dom': 'ReactDOM',
'aframe': 'AFRAME',
'3d-force-graph-vr': 'ForceGraphVR'
}
}
}
}
})