import { defineConfig } from "vite"; import react from "@vitejs/plugin-react-swc"; import { tanstackRouter } from "@tanstack/router-plugin/vite"; import * as path from "node:path"; import { fileURLToPath } from "node:url"; // https://vite.dev/config/ const __dirname = path.dirname(fileURLToPath(import.meta.url)); export default defineConfig({ plugins: [ tanstackRouter({ target: "react", autoCodeSplitting: true, }), react(), ], build: { target: "chrome86", }, resolve: { alias: { "@": path.resolve(__dirname, "./src"), }, }, server: { proxy: { "/api": { // target: "http://192.168.71.2:8080/", // 家 target: "http://192.168.1.28:8080/", // 公司 changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, ""), } }, }, });