-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
36 lines (32 loc) · 904 Bytes
/
Copy pathnext.config.js
File metadata and controls
36 lines (32 loc) · 904 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
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverActions: {
bodySizeLimit: '10mb',
},
},
// Output standalone for Electron
output: process.env.ELECTRON_BUILD === 'true' ? 'standalone' : undefined,
// Disable image optimization in Electron (not needed)
images: {
unoptimized: process.env.ELECTRON_BUILD === 'true',
},
webpack: (config, { isServer }) => {
if (isServer) {
// Ensure canvas is treated as optional (used by some PDF libraries)
config.externals = config.externals || [];
config.externals.push({
canvas: 'canvas',
});
}
// Disable webpack's fallback for Node.js modules in the browser
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
path: false,
crypto: false,
};
return config;
},
}
module.exports = nextConfig