-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
49 lines (47 loc) · 1.22 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
import { defineConfig, loadEnv } from "vite";
import vue from "@vitejs/plugin-vue";
import path from "path";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd());
return {
plugins: [vue()],
// this added so that dynamic components load properly on
// production
base: mode === "production" ? "/assets/elevator-ui/dist/" : "/",
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
// config options
css: {
preprocessorOptions: {
less: {
// this is needed for timelineJS
// without it vite will have problems resolving the icon
// urls in the less files
// see: https://github.com/vitejs/vite/issues/11382
rewriteUrls: "all",
},
},
},
build: {
manifest: true,
rollupOptions: {
input: "/src/main.ts",
},
sourcemap: true,
},
server: {
proxy: {
"/assets": env.VITE_API_PROXY_TARGET,
"/api": {
target: env.VITE_API_PROXY_TARGET,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ""),
cookieDomainRewrite: "localhost",
},
},
},
};
});