1 Star 0 Fork 11

量子风暴/EcoPaste

forked from ayangweb/EcoPaste 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts 1.38 KB
一键复制 编辑 原始数据 按行查看 历史
ayang 提交于 2024-10-11 21:53 . chore: 升级至 tauri v2 (#635)
import react from "@vitejs/plugin-react";
import UnoCSS from "unocss/vite";
import AutoImport from "unplugin-auto-import/vite";
import { defineConfig } from "vite";
const host = process.env.TAURI_DEV_HOST;
// https://vitejs.dev/config/
export default defineConfig(async () => ({
plugins: [
react(),
UnoCSS(),
AutoImport({
imports: ["react", "ahooks", "react-router-dom", "react-i18next"],
dts: "src/types/auto-imports.d.ts",
dirs: [
"src/router",
"src/utils",
"src/stores",
"src/database",
"src/hooks",
"src/constants",
"src/plugins",
"src/locales",
],
}),
],
resolve: {
alias: {
"@": "/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/**"],
},
},
build: {
chunkSizeWarningLimit: 3000,
},
css: {
preprocessorOptions: {
scss: {
// https://sass-lang.com/documentation/breaking-changes/legacy-js-api/#silencing-warnings
silenceDeprecations: ["legacy-js-api"],
},
},
},
}));
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/wuchunfu/EcoPaste.git
git@gitee.com:wuchunfu/EcoPaste.git
wuchunfu
EcoPaste
EcoPaste
v0.3.0-beta.1

搜索帮助

0d507c66 1850385 C8b1a773 1850385