-
Notifications
You must be signed in to change notification settings - Fork 5
/
vite.config.ts
95 lines (88 loc) · 1.86 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
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
92
93
94
95
/**
* Configuration file for Vite.
* @see {@link https://vitejs.dev/config/}
*/
import { sentryVitePlugin } from '@sentry/vite-plugin'
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
/**
* Plugins used by Vite.
*/
plugins: [
vue(),
//sentryVitePlugin({
// org: 'link-io',
// project: 'speckle-lca-frontend'
//})
],
/**
* Resolve configuration for Vite.
*/
resolve: {
/**
* Aliases for module resolution.
*/
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
/**
* Test configuration for Vite.
*/
test: {
/**
* Enable jest-like global test APIs.
*/
globals: true,
/**
* Simulate DOM with happy-dom.
* (requires installing happy-dom as a peer dependency)
*/
environment: 'happy-dom',
/**
* Setup files for tests.
*/
setupFiles: ['/src/tests/setup/globalSetup.ts']
},
/**
* Build configuration for Vite.
*/
build: {
/**
* Generate sourcemaps for debugging.
*/
outDir: 'dist',
sourcemap: true
},
base: '/SpeckleLCA/',
server: {
proxy: {
'/SpeckleLCA/api/revalu': {
target: 'https://api.revalu.io',
changeOrigin: true,
rewrite: (path) => {
return path.replace(/^\/SpeckleLCA\/api\/revalu/, '')
},
secure: true,
},
'/SpeckleLCA/api/eco': {
target: 'https://data.eco-platform.org',
changeOrigin: true,
rewrite: (path) => {
return path.replace(/^\/SpeckleLCA\/api\/eco/, ''); // Removes the entire prefix
},
secure: true,
},
'/SpeckleLCA/EPD-NORWAY_DIGI': {
target: 'https://epdnorway.lca-data.com/resource/processes/',
changeOrigin: true,
rewrite: (path) => {
return path.replace(/^\/SpeckleLCA\/EPD-NORWAY_DIGI/, ''); // Removes the entire prefix
},
secure: true,
},
},
},
})