This commit is contained in:
ryan
2026-07-13 15:17:45 +08:00
parent 08e61ce833
commit e0eb4e5975
334 changed files with 17212 additions and 12321 deletions
+26 -24
View File
@@ -1,33 +1,35 @@
import type {NextConfig} from "next";
import type { NextConfig } from 'next';
const isExport = process.env.NEXT_STANDALONE_EXPORT === 'true';
const nextConfig: NextConfig = {
reactCompiler: true,
experimental: {
},
...(isExport ? { output: 'export' } : {
async rewrites() {
const backendUrl = process.env.WAVELET_BACKEND_URL || 'http://localhost:8000';
return [
// 上传文件静态资源
{
source: '/f/:id',
destination: `${ backendUrl }/f/:id`,
experimental: {},
...(isExport
? { output: 'export' }
: {
async rewrites() {
const backendUrl =
process.env.WAVELET_BACKEND_URL || 'http://localhost:8000';
return [
// 上传文件静态资源
{
source: '/f/:id',
destination: `${backendUrl}/f/:id`,
},
// robots.txt 路由代理到后端动态接口
{
source: '/robots.txt',
destination: `${backendUrl}/robots.txt`,
},
// 标准 RESTful API 接口
{
source: '/api/:path*',
destination: `${backendUrl}/api/:path*`,
},
];
},
// robots.txt 路由代理到后端动态接口
{
source: '/robots.txt',
destination: `${ backendUrl }/robots.txt`,
},
// 标准 RESTful API 接口
{
source: '/api/:path*',
destination: `${ backendUrl }/api/:path*`,
}
];
},
})
}),
};
export default nextConfig;