前端配置提取 让开发和上线更加简便
This commit is contained in:
@@ -15,7 +15,7 @@ module.exports = {
|
||||
lintOnSave: process.env.NODE_ENV === 'development',
|
||||
productionSourceMap: false,
|
||||
devServer: {
|
||||
port: buildConf.vueClientPort,
|
||||
port: process.env.VUE_APP_CLI_PORT,
|
||||
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:` + buildConf.goServerPort + `/`, //代理到 目标路径
|
||||
target: `${process.env.VUE_APP_BASE_PATH}:${process.env.VUE_APP_SERVER_PORT}/`, //代理到 目标路径
|
||||
changeOrigin: true,
|
||||
pathRewrite: { // 修改路径数据
|
||||
['^' + process.env.VUE_APP_BASE_API]: '' // 举例 '^/api:""' 把路径中的/api字符串删除
|
||||
|
Reference in New Issue
Block a user