-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.js
64 lines (58 loc) · 1.95 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
54
55
56
57
58
59
60
61
62
63
64
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import mkcert from 'vite-plugin-mkcert'
import path from "path"
// https://vitejs.dev/config/
export default defineConfig({
server: {
https: false, // serve frontend over HTTPS (only!)
host: "0.0.0.0", // listen on localhost(127.0.0.1) and any local IP (192.168.*.*)
port: 3001,
// Problems with Cross-origin resource sharing (CORS)?
// Either allow all origins in the backend (see application.properties)
// OR
// Vue Dev serve can proxy API requests for you:
// https://cli.vuejs.org/config/#devserver-proxy
// https://github.com/http-party/node-http-proxy#options=
// https://github.com/chimurai/http-proxy-middleware/blob/master/README.md
/*
proxy: {
"^/q": {
target: "https://localhost:8443",
secure: false,
changeOrigin: true,
//TODO: cookieDomainRewrite: { "localhost:3001": "localhost:8443" }
},
"^/liquido-api/v3": { // Only proxy API requests. There are others, eg. Webservice "/ws" that sould stay
pathRewrite: { '^/liquido-api/v3' : '/' },
//ignorePath: true,
target: "https://localhost:8443", // the matched path will be appended to this!
secure: false // allow self-signed backend certificate
//ws: true, // also proxy-websockets
//changeOrigin: true
}
}
*/
},
plugins: [
vue(),
mkcert()
],
resolve: {
alias: {
// map @ to ./src but imports MUST have file endings (.js or .vue) !
'@' : fileURLToPath(new URL('./src', import.meta.url)),
// laod a specific config file per environment
'config': path.join(__dirname, "config/config."+process.env.NODE_ENV)
}
},
css: {
preprocessorOptions: {
scss: { //TODO: or SASS??
// import global variables, eg. "$primary"
additionalData: `@import "@/styles/_variables.scss";` //BUGFIX: was prependData
}
}
}
})