-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
42 lines (40 loc) · 972 Bytes
/
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
import {defineConfig} from 'vite'
import {join, resolve} from 'path'
import vue from '@vitejs/plugin-vue'
import UnoCSS from 'unocss/vite'
import Icons from "unplugin-icons/vite";
// 当前执行node命令时文件夹的地址(工作目录)
const root = process.cwd()
// 路径查找
function pathResolve(dir: string) {
return resolve(root, '.', dir)
}
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
UnoCSS(),
Icons({
compiler: "vue3",
autoInstall: true
})
],
server: {
proxy: {
'^/file': {
target: 'http://localhost:8080',
changeOrigin: true,
ws: true
},
}
},
resolve: {
alias: {
'@': join(__dirname, "src"),
}
},
esbuild: {
pure: ['console.log'], // 删除 console.log
drop: ['debugger'], // 删除 debugger
}
})