1 Star 0 Fork 0

Nieyq/spring-crm-frontend

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vite.config.ts 883 Bytes
一键复制 编辑 原始数据 按行查看 历史
Nieyq 提交于 2022-12-23 21:10 +08:00 . 菜单数据添加、删除、修改
import { fileURLToPath, URL } from 'node:url'
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import type { UserConfig, ConfigEnv } from 'vite' //从vite中获取三个方法
export default ({ mode }: ConfigEnv): UserConfig => {
const config = loadEnv(mode, './')
return {
plugins: [vue(), vueJsx()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
}
},
server: {
// port:3000,
proxy: {
[config.VITE_BASE_API]: { // 需要代理的路径 例如 '/api'
target: `${config.VITE_BASE_PATH}:${config.VITE_SERVER_PORT}/`, // 代理到 目标路径
changeOrigin: true,
rewrite: (path: string) => path.replace(new RegExp('^' + config.VITE_BASE_API), ''),
}
},
},
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/y1217/spring-crm-frontend.git
[email protected]:y1217/spring-crm-frontend.git
y1217
spring-crm-frontend
spring-crm-frontend
master

搜索帮助