0d20e1413f
- 安装 @appica/ui-react、@appica/icons-react、tailwindcss、@tailwindcss/vite - vite.config 添加 tailwindcss 插件 - 新增 src/styles/global.css 引入 Tailwind 与 Appica 设计令牌 - main.jsx 包裹 ThemeProvider(主题防闪烁)
27 lines
715 B
JavaScript
27 lines
715 B
JavaScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig(async () => ({
|
|
plugins: [react(), tailwindcss()],
|
|
|
|
clearScreen: false,
|
|
server: {
|
|
port: 1420,
|
|
strictPort: true,
|
|
// 监听所有网络接口,局域网内其他设备可通过 http://<IP>:1420 访问
|
|
host: true,
|
|
watch: {
|
|
ignored: ["**/src-tauri/**"],
|
|
},
|
|
// 开发时代理 API 请求到 Rust 后端
|
|
proxy: {
|
|
'/api': 'http://localhost:10801',
|
|
'/file': 'http://localhost:10801',
|
|
'/media': 'http://localhost:10801',
|
|
'/upload': 'http://localhost:10801',
|
|
},
|
|
},
|
|
}));
|