Files
NianAIGC/next.config.ts
2026-09-23 13:33:47 +08:00

44 lines
1.2 KiB
TypeScript

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
output: "export",
// Keep dev artifacts separate from production builds. Running `next build`
// while a dev server is alive must not invalidate the dev server's chunks.
distDir: process.env.NODE_ENV === "development" ? ".next-dev" : ".next",
devIndicators: false,
...(process.env.NODE_ENV === "development"
? {
async rewrites() {
const backend = "http://127.0.0.1:8080";
return [
{
source: "/api/:path*",
destination: `${backend}/api/:path*`
},
{
source: "/uploads/:path*",
destination: `${backend}/uploads/:path*`
},
{
source: "/generated-results/:path*",
destination: `${backend}/generated-results/:path*`
}
];
}
}
: {}),
images: {
unoptimized: true,
remotePatterns: [
{ protocol: "https", hostname: "**" },
{ protocol: "http", hostname: "127.0.0.1" },
{ protocol: "http", hostname: "localhost" }
]
}
};
export default nextConfig;