1 Star 28 Fork 4

ayangweb/BongoCat

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts 945 Bytes
一键复制 编辑 原始数据 按行查看 历史
ayangweb 提交于 2025-04-01 09:29 +08:00 . chore: support for path aliases (#25)
import { resolve } from 'node:path'
import { env } from 'node:process'
import vue from '@vitejs/plugin-vue'
import UnoCSS from 'unocss/vite'
import { defineConfig } from 'vite'
const host = env.TAURI_DEV_HOST
// https://vitejs.dev/config/
export default defineConfig(async () => ({
plugins: [vue(), UnoCSS()],
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
},
},
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
//
// 1. prevent vite from obscuring rust errors
clearScreen: false,
// 2. tauri expects a fixed port, fail if that port is not available
server: {
port: 1420,
strictPort: true,
host: host || false,
hmr: host
? {
protocol: 'ws',
host,
port: 1421,
}
: undefined,
watch: {
// 3. tell vite to ignore watching `src-tauri`
ignored: ['**/src-tauri/**'],
},
},
}))
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/ayangweb/BongoCat.git
git@gitee.com:ayangweb/BongoCat.git
ayangweb
BongoCat
BongoCat
master

搜索帮助