Files
OpenFlare/frontend/next.config.ts
T
ryan 6a53619dd2 feat(framework): 回灌 OpenFlare 分层、安全与运行时改进
将平台域持久化收敛为 repository 唯一入口,model 去掉 IO。
邮件头写入前清除 CR/LF,防止 header 注入。
httppool 支持可配置 Transport;batchwriter 增加 MinBatchSize/Stats,flush 失败交回批次;任务 PermanentError 作为 SkipRetry 终态。
设置与推送页的确认改为 AlertDialog;axios 去尾斜杠并按 Gin 数组序列化查询参数。
升级共享 Go 依赖(Gin、Asynq、OTel、GORM、Redis 等)。
2026-08-16 11:07:20 +08:00

41 lines
1.2 KiB
TypeScript

import type { NextConfig } from 'next';
import createNextIntlPlugin from 'next-intl/plugin';
const withNextIntl = createNextIntlPlugin('./i18n/request.ts');
const isExport = process.env.NEXT_STANDALONE_EXPORT === 'true';
const nextConfig: NextConfig = {
reactCompiler: true,
// Prevent 308 redirects on /api/* trailing slashes; dev rewrites proxy legacy APIs as-is.
skipTrailingSlashRedirect: 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`,
},
// robots.txt 路由代理到后端动态接口
{
source: '/robots.txt',
destination: `${backendUrl}/robots.txt`,
},
// 标准 RESTful API 接口
{
source: '/api/:path*',
destination: `${backendUrl}/api/:path*`,
},
];
},
}),
};
export default withNextIntl(nextConfig);