Files
CICD_Learning/front/vite.config.ts
2025-09-02 23:01:23 +08:00

23 lines
572 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
server: {
// 监听所有IP地址
host: "0.0.0.0",
// 指定dev sever的端口号为5555
port: 5555,
// 自动打开浏览器运行以下页面
open: "/",
// 设置反向代理
proxy: {
// 以下示例表示请求URL中含有"/api",则反向代理到后端
"/api": {
target: "http://localhost:5000/",
changeOrigin: true,
},
},
},
});