Files
infinite-canvas/web/next.config.ts
T
HouYunFei 7ce3044781 fix(canvas): 解决画布节点拖拽操作被控件拦截问题
- 在 CanvasConfigNodePanel 组件中为 Segmented 控件添加事件阻止传播
- 为输入框和按钮组件添加 onMouseDown 事件阻止传播
- 为 ModelPicker 和 CanvasSizePicker 的下拉菜单添加事件阻止传播
- 更新 API 基础 URL 默认端口从 8080 改为 3000
- 更新开发服务器端口配置为 3001
- 在 CHANGELOG 中更新修复说明
2026-05-19 20:56:25 +08:00

22 lines
760 B
TypeScript

import type { NextConfig } from "next";
import { PHASE_DEVELOPMENT_SERVER } from "next/constants";
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { dirname, resolve } from "node:path";
const apiBaseUrl = process.env.API_BASE_URL || "http://127.0.0.1:3000";
const webDir = dirname(fileURLToPath(import.meta.url));
const version = readFileSync(resolve(webDir, "../VERSION"), "utf8").trim() || "dev";
export default function nextConfig(phase: string): NextConfig {
const isDev = phase === PHASE_DEVELOPMENT_SERVER;
return {
env: {
NEXT_PUBLIC_APP_VERSION: version,
},
async rewrites() {
return isDev ? [{ source: "/api/:path*", destination: `${apiBaseUrl}/api/:path*` }] : [];
},
};
}