Initial commit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
谢宇宁
2026-11-05 20:30:26 +07:00
co-authored by Claude Opus 5.5
commit 6bd5cc665a
335 changed files with 44261 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import type { NextConfig } from "next";
/** 本地调试代理目标,见 config/*.env / .env.local 的 API_PROXY_TARGET */
const apiProxyTarget = (process.env.API_PROXY_TARGET || "").replace(/\/$/, "");
const appEnv = process.env.APP_ENV;
const nextConfig: NextConfig = {
output: "standalone",
// 仅在显式 APP_ENV=test|development 时分目录;未设置 / production 仍用 .next
distDir:
appEnv === "test" ? ".next-test" : appEnv === "development" ? ".next-dev" : ".next",
poweredByHeader: false,
cacheComponents: true,
partialPrefetching: true,
// 用 127.0.0.1 打开本地 dev 时允许 HMR(默认只放行 localhost)
allowedDevOrigins: ["127.0.0.1"],
async rewrites() {
if (!apiProxyTarget) return [];
return [
{
source: "/api/:path*",
destination: `${apiProxyTarget}/api/:path*`,
},
// /h5/m3u8、/enkey、/newenkey 由 route handler 代理,密钥地址不带尾斜杠
];
},
};
export default nextConfig;