ai-chatbot/next.config.ts
Your Name db070f8a37
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
fix: increase request body size limit to 500MB for video uploads
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-01-31 21:32:07 +08:00

44 lines
1.3 KiB
TypeScript
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.

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// 禁用 cacheComponents 以支持 dynamic = "force-dynamic"
// cacheComponents: true,
typescript: {
ignoreBuildErrors: true, // 临时禁用类型检查以加快开发
},
// 增加请求体大小限制以支持大文件上传(视频等)
serverActions: {
bodySizeLimit: "500mb",
},
// 实验性功能:增加中间件和代理请求体大小限制
experimental: {
serverComponentsExternalPackages: ["sharp"],
middlewareClientMaxBodySize: "500mb", // 中间件请求体限制
proxyClientMaxBodySize: "500mb", // 代理请求体限制
},
images: {
remotePatterns: [
{
hostname: "avatar.vercel.sh",
},
{
protocol: "https",
//https://nextjs.org/docs/messages/next-image-unconfigured-host
hostname: "*.public.blob.vercel-storage.com",
},
{
// 支持 HTTP 协议的 MinIO / S3(本地或内网部署)
protocol: "http",
hostname: "**", // 允许所有 HTTP 域名(MinIO 等)
},
{
// 支持 HTTPS 协议的 S3 / MinIO(公网部署)
protocol: "https",
hostname: "**", // 允许所有 HTTPS 域名
},
],
},
};
export default nextConfig;