4 Star 4 Fork 0

洪启迪/crazyshopping

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vite.config.js 734 Bytes
一键复制 编辑 原始数据 按行查看 历史
洪启迪 提交于 2024-06-09 18:26 . 打包优化
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import axios from "axios";
export default defineConfig({
plugins: [
vue(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
esbuild: {
target: 'es2022' // 或者 'esnext'
},
publicPath: './',
lintOnSave: true,
devServer: {
proxy: {
'/': {
target: axios.defaults.baseURL, // 代理地址,这里设置的地址会代替axios中设置的baseURL
changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
ws: true,
pathRewrite: {
'^/': ''
}
},
}
}
})
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/PPPphong/crazyshopping.git
git@gitee.com:PPPphong/crazyshopping.git
PPPphong
crazyshopping
crazyshopping
master

搜索帮助