forked from YuanShiJiLoong/author
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
42 lines (39 loc) · 1006 Bytes
/
Copy pathnext.config.mjs
File metadata and controls
42 lines (39 loc) · 1006 Bytes
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
import { readFileSync } from 'fs';
const { version } = JSON.parse(readFileSync('./package.json', 'utf-8'));
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
devIndicators: false,
env: {
NEXT_PUBLIC_APP_VERSION: version,
},
// pdf-parse / word-extractor 仅在服务端 API 路由中使用,标记为外部包避免打包解析
serverExternalPackages: ['pdf-parse', 'word-extractor'],
outputFileTracingExcludes: {
'*': [
'mobile/**/*',
'docs/**/*',
'.idea/**/*',
'.agent/**/*',
'.venv/**/*',
'build/**/*',
'dist/**/*',
'dist-*',
'dist-*/**/*',
'local-clients-v*',
'local-clients-v*/**/*'
],
},
outputFileTracingIncludes: {
'*': [
'node_modules/next/dist/**/*',
],
},
// 提高请求体大小限制,避免大 PDF/DOC 文件上传时返回 413
experimental: {
serverActions: {
bodySizeLimit: '50mb',
},
},
};
export default nextConfig;