-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
61 lines (59 loc) · 1.29 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 tailwindcss from '@tailwindcss/vite';
import react from '@vitejs/plugin-react-swc';
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vite';
import { configDefaults } from 'vitest/config';
// The target API base URL
const target = process.env.API_BASE_URL ?? 'http://localhost:9080';
// https://vitejs.dev/config/
export default defineConfig({
base: '/yksilo/',
plugins: [react(), tailwindcss()],
test: {
environment: 'jsdom',
globals: true,
exclude: [...configDefaults.exclude, 'e2e'],
setupFiles: ['./vitest.setup.ts', './src/i18n/config.ts'],
coverage: {
provider: 'v8',
reporter: ['lcov'],
},
},
resolve: {
alias: [
{
find: '@',
replacement: fileURLToPath(new URL('./src', import.meta.url)),
},
],
},
server: {
port: 8080,
proxy: {
'/yksilo/api': {
target,
xfwd: true,
},
'/yksilo/login': {
target,
xfwd: true,
},
'/yksilo/saml2': {
target,
xfwd: true,
},
'/yksilo/logout': {
target,
xfwd: true,
},
'/yksilo/openapi': {
target,
xfwd: true,
},
'/urataidot': {
target: 'http://localhost:5173',
xfwd: true,
},
},
},
});