-
Notifications
You must be signed in to change notification settings - Fork 7
/
vite.config.ts
53 lines (52 loc) · 1.14 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
48
49
50
51
52
53
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from "unplugin-vue-components/vite";
import { VantResolver } from "@vant/auto-import-resolver"
import ViteCompression from 'vite-plugin-compression'
import path from "path"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
Components({
resolvers: [VantResolver()],
}),
ViteCompression({
verbose: true,
disable: false,
threshold: 10240,
})
],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
}
},
base: process.env.NODE_ENV === 'production' ? "/" : "./",
server: {
host: '0.0.0.0',
port: 8303,
open: true,
proxy: {
'/api': {
target: 'http://127.0.0.1:10008',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
},
build: {
chunkSizeWarningLimit: 500,
rollupOptions: {
output: {
manualChunks: {
lodash: ['lodash'],
vant: ['vant'],
echarts: ['echarts'],
vueuse: ['@vueuse/core'],
axios: ['axios']
}
}
}
}
})