-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
69 lines (67 loc) · 1.89 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import viteCompression from 'vite-plugin-compression'
const timeStamp = new Date().getTime()
export default defineConfig({
plugins: [
vue(),
viteCompression({
threshold: 10000 // 对大于 10kb 的文件进行压缩 单位是b
})
],
base: '/three/',
resolve: {
alias: {
'@': '/src'
}
},
build: {
chunkSizeWarningLimit: 1024000, // 对大于 1000mb
rollupOptions: {
output: {
chunkFileNames: `assets/js/[name]-[hash].${timeStamp}.js`,
entryFileNames: `assets/js/[name]-[hash].${timeStamp}.js`,
assetFileNames: `assets/[ext]/[name]-[hash].${timeStamp}.[ext]`
}
}
},
server: {
port: 3001,
host: '0.0.0.0',
hmr: true,
proxy: {
'/airSourceURL': {
target: 'http://218.59.142.130:10010',
changeOrigin: true,
secure: false,
rewrite: path => path.replace(/^\/airSourceURL/, '')
},
'/wryStateIP': {
target: 'http://218.59.142.130:10010/wf-api',
changeOrigin: true,
secure: false,
rewrite: path => path.replace(/^\/wryStateIP/, '')
},
'/getAirForcastData': {
target: 'http://218.59.142.130:10010/paas',
changeOrigin: true,
secure: false,
rewrite: path => path.replace(/^\/getAirForcastData/, '')
},
'/gettargetmanage': {
// target: 'http://192.168.1.55:9010/',
target: 'http://10.211.128.186:2222/gateway/water-service',
changeOrigin: true,
secure: false,
rewrite: path => path.replace(/^\/gettargetmanage/, '')
},
'/drinkingWater': {
target: 'http://192.168.1.19:9010',
// target: 'http://10.211.128.186:2222/water/',
changeOrigin: true,
secure: false,
rewrite: path => path.replace(/^\/drinkingWater/, '')
}
}
}
})