-
Notifications
You must be signed in to change notification settings - Fork 38
/
vite.config.ts
61 lines (59 loc) · 1.38 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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import { viteStaticCopy } from 'vite-plugin-static-copy'
import svgr from "vite-plugin-svgr"
const backendPort = process.env.PORT || 8080;
const clientPort = process.env.CLIENT_PORT || 3000;
// https://vitejs.dev/config/
export default defineConfig({
//root: 'client/src',
build: {
// Relative to the root
// Note: This has to match the path in `relay/index.mjs`
outDir: 'client/dist',
},
plugins: [
react(),
svgr({
svgrOptions: {
// svgr options
},
}),
viteStaticCopy({
targets: [
{
src: 'node_modules/@leanprover/infoview/dist/*.production.min.js',
dest: '.'
}
]
})
],
publicDir: "client/public",
base: "/", // setting this to `/leangame/` means the server is now accessible at `localhost:3000/leangame`
optimizeDeps: {
exclude: ['games']
},
server: {
port: Number(clientPort),
proxy: {
'/websocket': {
target: `ws://localhost:${backendPort}`,
ws: true
},
'/import': {
target: `http://localhost:${backendPort}`,
},
'/data': {
target: `http://localhost:${backendPort}`,
},
'/i18n': {
target: `http://localhost:${backendPort}`,
},
}
},
resolve: {
alias: {
path: "path-browserify",
},
},
})