27 lines
656 B
JavaScript
27 lines
656 B
JavaScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig(async () => ({
|
|
plugins: [react()],
|
|
|
|
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',
|
|
},
|
|
},
|
|
}));
|