7 Star 2 Fork 0

国服第一厉害 / data-scenario-container

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vite.config.ts 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
王亚洲 提交于 2024-03-19 16:15 . 修改前端环境变量配置
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
const pathSrc = path.resolve(__dirname, 'src')
// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
// Load env file based on `mode` in the current working directory.
// Set the third parameter to '' to load all env regardless of the `VITE_` prefix.
const env = loadEnv(mode, process.cwd(), '')
return {
plugins: [vue()],
resolve: {
alias: {
"~/": `${pathSrc}/`,
}
},
base: env.VITE_ROUTER_PREFIX,
server: {
host: "0.0.0.0",
port: 8889,
proxy: {
//添加百度地图api代理配置
'/baidu_api': {
target: 'https://api.map.baidu.com',
ws: true,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/baidu_api/, '')
},
'/shuikeyuan': {
target: 'http://223.2.32.197:8700',
ws: true,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/shuikeyuan/, '')
},
'/test': {
target: 'http://172.21.213.62:7890',
ws: true,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/test/, '')
}
},
hmr: true
},
}
})
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/carriefish/data-scenario-container.git
git@gitee.com:carriefish/data-scenario-container.git
carriefish
data-scenario-container
data-scenario-container
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891