-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
51 lines (49 loc) · 1.21 KB
/
vite.config.js
File metadata and controls
51 lines (49 loc) · 1.21 KB
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 { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { resolve } from "path";
// https://vite.dev/config/
export default defineConfig(({ command, mode }) => {
const isQuickBuild = mode === "development";
return {
plugins: [vue()],
base: "./",
build: {
outDir: "dist",
minify: isQuickBuild ? false : "terser",
terserOptions: isQuickBuild
? undefined
: {
compress: {
drop_console: isQuickBuild ? false : true,
drop_debugger: true,
},
},
rollupOptions: {
input: {
main: resolve(__dirname, "index.html"),
background: resolve(__dirname, "public/background.js"),
},
output: {
entryFileNames: "[name].js",
chunkFileNames: "[name].js",
assetFileNames: "[name].[ext]",
},
},
},
resolve: {
alias: {
"@": resolve(__dirname, "src"),
},
},
server: {
port: 3001,
proxy: {
"/api": {
target: "https://open.feishu.cn/open-apis",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ""),
},
},
},
};
});