Repository navigation
Expand file tree
/
Copy pathvite.config.mjs
More file actions
91 lines (89 loc) · 2.01 KB
/
Copy pathvite.config.mjs
File metadata and controls
91 lines (89 loc) · 2.01 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig(({ command, mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
base: '/ui',
build: {
outDir: 'build',
sourcemap: true,
rollupOptions: {
onLog(level, log, handler) {
if (log.cause && log.cause.message === `Can't resolve original location of error.`) {
return;
}
handler(level, log);
},
output: {
manualChunks(id) {
if (id.includes('react')) {
return 'react';
}
if (id.includes('joi')) {
return 'joi';
}
}
}
}
},
css: {
preprocessorOptions: {
scss: {
quietDeps: true,
/* https://github.com/twbs/bootstrap/issues/40962 */
silenceDeprecations: [
'mixed-decls',
'color-functions',
'global-builtin',
'import',
'if-function'
]
}
}
},
define: {
global: 'window'
},
server: {
clearScreen: false,
port: 4000,
open: false,
proxy: {
'/api': {
target: env.APP_BASE_URL || 'http://localhost:8081'
},
'/login': {
target: env.APP_BASE_URL || 'http://localhost:8081'
},
'/logout': {
target: env.APP_BASE_URL || 'http://localhost:8081'
},
'/oauth': {
target: env.APP_BASE_URL || 'http://localhost:8081'
}
}
},
preview: {
port: 4000,
open: false,
proxy: {
'/api': {
target: 'http://akhq:8080'
},
'/login': {
target: 'http://akhq:8080'
},
'/logout': {
target: 'http://akhq:8080'
},
'/oauth': {
target: 'http://akhq:8080'
}
}
},
plugins: [react()],
test: {
environment: 'jsdom'
}
};
});