-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
47 lines (44 loc) · 1.01 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
import { fileURLToPath, URL } from "node:url";
import { defineConfig, loadEnv } from "vite";
import vue from "@vitejs/plugin-vue";
// load all node_modules in a vendor chunk file
// see: https://rollupjs.org/configuration-options/#output-manualchunks
function manualChunks(id: string) {
if (id.includes("node_modules")) {
return "vendor";
}
}
// https://vitejs.dev/config/
export default defineConfig(({ _command, mode }) => {
const env = loadEnv(mode, process.cwd());
return {
plugins: [vue()],
build: {
sourcemap: true,
manifest: true,
rollupOptions: {
output: {
manualChunks,
},
},
},
server: {
proxy: {
"/printnanny/api/": {
target: "http://localhost:8585",
},
},
},
envDir: ".env",
resolve: {
preserveSymlinks: true,
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
define: {
"process.env": {},
UnixTransport: {},
},
};
});