-
-
Notifications
You must be signed in to change notification settings - Fork 310
Expand file tree
/
Copy pathnext.config.ts
More file actions
44 lines (37 loc) · 1.42 KB
/
next.config.ts
File metadata and controls
44 lines (37 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import type { NextConfig } from "next";
import createNextIntlPlugin from "next-intl/plugin";
// Create next-intl plugin with i18n request configuration
const withNextIntl = createNextIntlPlugin("./src/i18n/request.ts");
const nextConfig: NextConfig = {
output: "standalone",
// 转译 ESM 模块(@lobehub/icons 需要)
transpilePackages: ["@lobehub/icons"],
// 排除服务端专用包(避免打包到客户端)
// bull 和相关依赖只在服务端使用,包含 Node.js 原生模块
// postgres 和 drizzle-orm 包含 Node.js 原生模块(net, tls, crypto, stream, perf_hooks)
serverExternalPackages: [
"bull",
"bullmq",
"@bull-board/api",
"@bull-board/express",
"ioredis",
"postgres",
"drizzle-orm",
],
// 强制包含 undici 和 fetch-socks 到 standalone 输出
// Next.js 依赖追踪无法正确追踪动态导入和类型导入的传递依赖
// 参考: https://nextjs.org/docs/app/api-reference/config/next-config-js/output
outputFileTracingIncludes: {
"/**": ["./node_modules/undici/**/*", "./node_modules/fetch-socks/**/*"],
},
// 文件上传大小限制(用于数据库备份导入)
// Next.js 15 通过 serverActions.bodySizeLimit 统一控制
experimental: {
serverActions: {
bodySizeLimit: "500mb",
},
proxyClientMaxBodySize: "100mb",
},
};
// Wrap the Next.js config with next-intl plugin
export default withNextIntl(nextConfig);