-
Notifications
You must be signed in to change notification settings - Fork 120
/
vite.config.js
43 lines (42 loc) · 961 Bytes
/
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
import { defineConfig } from 'vite'
import { resolve } from 'path'
import vue from '@vitejs/plugin-vue'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
export default defineConfig({
base: './',
telemetry: false,
server: {
port: 9528, // 服务启动端口号
open: true, // 服务启动时是否自动打开浏览器
proxy: {
'/gateway': {
target: 'http://localhost:7700',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/gateway/, '')
}
}
},
resolve: {
alias: {
'@': resolve(__dirname, '.', 'src')
}
},
plugins: [
vue(),
createSvgIconsPlugin({
iconDirs: [resolve(process.cwd(), 'src/assets/svg')],
symbolId: 'icon-[name]'
})
],
build: {
minify: 'terser',
emptyOutDir: true,
chunkSizeWarningLimit: 1500,
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true
}
}
}
})