-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
64 lines (64 loc) · 1.68 KB
/
vue.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
const { defineConfig } = require('@vue/cli-service')
var version = new Date()
const HttpsProxyAgent = require('https-proxy-agent')
const proxyServer = process.env.http_proxy || 'http://192.168.1.71:21081'
const agent = new HttpsProxyAgent(proxyServer)
module.exports = defineConfig({
devServer: {
port: 8089,
host: '0.0.0.0',
open: true,
// https: true
proxy: {
//配置跨域
'/api2': {
target: 'http://10.0.0.110:8006/',
changOrigin: true, //允许跨域
pathRewrite: {
'^/api2': '/api2',
},
},
'/webapp': {
target: 'http://10.0.0.110/',
changOrigin: true, //允许跨域
agent,
pathRewrite: {
'^/webapp': '/webapp',
},
},
'/api': {
target: 'http://10.0.0.215:8428/',
changOrigin: true, //允许跨域
pathRewrite: {
'^/api': '/api',
},
},
'/socket': {
target: 'ws://10.0.0.215:8090/', //后端目标接口地址
changeOrigin: true, //是否允许跨域
pathRewrite: {
'^/socket': '', //重写,
},
ws: false, //开启ws
secure: false,
},
},
},
chainWebpack: (config) => {
config.plugin('html').tap((args) => {
args[0].title = '管理平台'
return args
}),
config.plugin('define').tap((args) => {
args[0]['process.env'].version = JSON.stringify(version)
return args
})
},
publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
outputDir: 'project',
assetsDir: 'static',
indexPath: 'index.html',
lintOnSave: false,
transpileDependencies: true,
productionSourceMap: false,
})