2 Star 0 Fork 0

污橘 / 木鱼前端

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vite.config.js 925 Bytes
一键复制 编辑 原始数据 按行查看 历史
污橘 提交于 2023-05-22 23:52 . 2023年5月22日23:52:20
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import path from 'path';
import components from 'unplugin-vue-components/vite';
import autoImport from 'unplugin-auto-import/vite';
import { VarletUIResolver } from 'unplugin-vue-components/resolvers';
export default defineConfig({
// 编译后的baseurl
base : '/',
server: {
// 端口
port : 3000,
host: '0.0.0.0', // 为了能在局域网上用
// 解决烦人的跨域
proxy: {
'/api': {
target: 'http://154.39.107.215:1027/',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
}
},
plugins: [
vue(),
// 按需引入
components({
resolvers: [VarletUIResolver()]
}),
autoImport({
resolvers: [VarletUIResolver({ autoImport: true })]
})
]
})
1
https://gitee.com/v8r/fish2022-web.git
git@gitee.com:v8r/fish2022-web.git
v8r
fish2022-web
木鱼前端
master

搜索帮助