Files
course-agent-od/web/next.config.js
T
pengxiao ddbb79b9f6 Initial commit: 国土空间规划课程智能体 v1.0
单容器 Docker 架构的国土空间规划课程智能问答系统,集成 FastAPI 后端与 Next.js 前端。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 09:40:18 +08:00

44 lines
1017 B
JavaScript
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.
/** @type {import('next').NextConfig} */
const nextConfig = {
// 启用 standalone 输出模式(用于 Docker
output: 'standalone',
experimental: {
turbo: {
rules: {
'*.svg': {
loaders: ['@svgr/webpack'],
as: '*.js',
},
},
},
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: '**',
},
],
},
async rewrites() {
// 在容器环境中,前端和后端在同一容器内,可以直接访问
const backendUrl = process.env.NEXT_PUBLIC_BACKEND_URL || 'http://localhost:8000';
return [
{
source: '/api/:path*',
destination: `${backendUrl}/:path*`,
},
{
source: '/generated_images/:path*',
destination: `${backendUrl}/generated_images/:path*`,
},
];
},
// 禁用静态生成,避免 SSR 时使用浏览器 API 的错误
generateBuildId: async () => {
return 'build-' + Date.now();
},
};
export default nextConfig;