-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvite.config.js
51 lines (50 loc) · 1.1 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
import vue from "@vitejs/plugin-vue2";
import { fileURLToPath } from "url";
import { defineConfig, loadEnv } from "vite";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
/** @type {import('vite').UserConfig} */
return {
plugins: [vue()],
// custom port instead of 5173 always
preview: {
port: env.PORT,
},
server: {
port: env.PORT,
},
optimizeDeps: {
esbuildOptions: {
target: "esnext",
},
},
build: {
target: "esnext",
chunkSizeWarningLimit: 1000,
rollupOptions: {
output: {
manualChunks: {
vue_core: [
"vue",
"vue-router",
"vue-calendar-heatmap",
"vue-prism-editor",
"vue-tippy",
],
// biggest dependencies get separate files
vue_graph: ["vue-graph"],
vuetify: ["vuetify"],
},
},
},
},
resolve: {
alias: {
// stupid fix for vite/vue interop
vue: "vue/dist/vue.esm.js",
"@helpers": fileURLToPath(new URL("./helpers", import.meta.url)),
"@components": fileURLToPath(new URL("./components", import.meta.url)),
},
},
};
});