-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnext.config.js
More file actions
38 lines (35 loc) · 933 Bytes
/
next.config.js
File metadata and controls
38 lines (35 loc) · 933 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
/** @type {import('next').NextConfig} */
const nextConfig = {
eslint: {
// 跳过构建时的 ESLint 检查(避免版本兼容问题)
ignoreDuringBuilds: true,
},
typescript: {
// 跳过构建时的类型检查(本地已验证)
ignoreBuildErrors: true,
},
experimental: {
serverActions: {
bodySizeLimit: '10mb',
},
},
webpack: (config, { isServer }) => {
if (isServer) {
// Externalize OCR dependencies to avoid webpack bundling
config.externals = [
...config.externals,
'tesseract.js',
'pdf-to-png-converter',
'@napi-rs/canvas',
'canvas',
];
}
// Configure pdfjs-dist to work with webpack
config.resolve.alias = {
...config.resolve.alias,
'pdfjs-dist/build/pdf.worker.entry': 'pdfjs-dist/legacy/build/pdf.worker.entry',
};
return config;
},
};
module.exports = nextConfig;