集中配置端口

This commit is contained in:
东邪黄药师
2021-03-08 23:43:17 +08:00
parent 48bb3b6452
commit 7bf3294113
4 changed files with 9 additions and 5 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ module.exports = {
lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false,
devServer: {
port: 8080,
port: buildConf.vueClientPort,
open: true,
overlay: {
warnings: false,
@@ -25,7 +25,7 @@ module.exports = {
// 把key的路径代理到target位置
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { //需要代理的路径 例如 '/api'
target: `http://127.0.0.1:8888/`, //代理到 目标路径
target: `http://127.0.0.1:` + buildConf.port + `/`, //代理到 目标路径
changeOrigin: true,
pathRewrite: { // 修改路径数据
['^' + process.env.VUE_APP_BASE_API]: '' // 举例 '^/api:""' 把路径中的/api字符串删除