ai-chatbot/next.config.ts
Your Name 077451de2f
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
fix: use correct Next.js 16 config for body size limit
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-01-31 21:32:38 +08:00

40 lines
1.1 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, // 临时禁用类型检查以加快开发
},
// 外部包配置(Next.js 16+)
serverExternalPackages: ["sharp"],
// 实验性功能:增加代理请求体大小限制以支持大文件上传(视频等)
experimental: {
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;