1 Star 0 Fork 0

games.gong / vue3+vite+ts+element plus

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vite.config.ts 698 Bytes
一键复制 编辑 原始数据 按行查看 历史
弓艳军 提交于 2023-07-28 15:25 . 隐藏上传
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
resolve:{ alias: {'@': path.resolve(__dirname, 'src')}},
server: {
proxy: {
'/api': {
target: 'http://localhost:3000/', // 设置代理目标
changeOrigin: true, // 允许跨域
rewrite: (path) => {
console.log("path",path)
return path.replace(/^\/api/, '')
}, // 重写路径
},
},
},
// css: {
// loaderOptions: {
// sass: {
// // 根据需要设置其他配置,比如全局变量等
// },
// },
// },
})
1
https://gitee.com/gamesgong/vue3-vite-ts-element-plus.git
git@gitee.com:gamesgong/vue3-vite-ts-element-plus.git
gamesgong
vue3-vite-ts-element-plus
vue3+vite+ts+element plus
master

搜索帮助