-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
44 lines (43 loc) · 1.2 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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import { TanStackRouterVite } from '@tanstack/router-plugin/vite'
import { compression } from 'vite-plugin-compression2'
import { codecovVitePlugin } from '@codecov/vite-plugin'
// https://vite.dev/config/
export default defineConfig({
plugins: [
TanStackRouterVite({ routesDirectory: 'src/ui/routes/', generatedRouteTree: 'src/ui/routeTree.gen.ts' }),
react(),
compression(),
// Put the Codecov vite plugin after all other plugins
codecovVitePlugin({
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
bundleName: 'vdoc',
uploadToken: process.env.CODECOV_TOKEN,
telemetry: false,
}),
],
root: 'src/ui',
build: {
outDir: '../vdoc/webapp',
emptyOutDir: true,
sourcemap: true,
},
server: {
proxy: process.env.USE_VITE_PROXY
? {
'/api': {
target: 'http://localhost:8080',
changeOrigin: false,
secure: false,
},
'/static': {
target: 'http://localhost:8080',
changeOrigin: false,
secure: false,
},
}
: {},
host: '0.0.0.0',
},
})