feat 集成shadcn

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
PoRi
2026-04-25 13:12:44 +08:00
parent e9a33e74fd
commit 5ca96c4092
18 changed files with 6482 additions and 125 deletions
+12 -6
View File
@@ -1,17 +1,23 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from '@tailwindcss/vite'
import path from "node:path";
// @ts-expect-error process is a nodejs global
const host = process.env.TAURI_DEV_HOST;
// https://vite.dev/config/
export default defineConfig(async () => ({
plugins: [react()],
plugins: [react(), tailwindcss(),],
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
//
// 1. prevent Vite from obscuring rust errors
clearScreen: false,
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
// 2. tauri expects a fixed port, fail if that port is not available
server: {
port: 1420,
@@ -19,10 +25,10 @@ export default defineConfig(async () => ({
host: host || false,
hmr: host
? {
protocol: "ws",
host,
port: 1421,
}
protocol: "ws",
host,
port: 1421,
}
: undefined,
watch: {
// 3. tell Vite to ignore watching `src-tauri`