-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
54 lines (47 loc) · 1.45 KB
/
vite.config.js
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
import { fileURLToPath, URL } from 'url'
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
export default ({ mode }) => {
// Load app-level env vars to node-level env vars.
process.env = {...process.env, ...loadEnv(mode, process.cwd())};
console.log('PUBLIC URL: ' + process.env.VITE_PUBLIC_PATH)
return defineConfig({
// To access env vars here use process.env.TEST_VAR
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
base: process.env.VITE_PUBLIC_PATH + '/',
//base: '/s/kukako/',
//base: '/',
// base: process.env.NODE_ENV === 'production'
// ? '/s/kukako/'
// : '/',
server: {
proxy: {
'/ws': {
target: 'http://localhost:8200',
changeOrigin: true,
ws: true,
},
'/api': {
target: 'http://localhost:8200',
changeOrigin: true,
ws: true,
},
'/images': {
target: 'http://localhost:8200',
changeOrigin: true,
ws: true,
},
'/icons': {
target: 'http://localhost:8200',
changeOrigin: true,
ws: true,
}
}
}
});
}