forked from DragosOnisei/FrameComment
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
87 lines (82 loc) · 2.9 KB
/
Copy pathnext.config.js
File metadata and controls
87 lines (82 loc) · 2.9 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
const createNextIntlPlugin = require('next-intl/plugin')
const withNextIntl = createNextIntlPlugin('./src/i18n/request.ts')
/** @type {import('next').NextConfig} */
const nextConfig = {
poweredByHeader: false,
// Allow LAN IPs to access the dev server (phone testing on local Wi-Fi).
// Next.js 15+ blocks cross-origin _next/* requests in dev with 403 otherwise.
// Only affects dev mode — production is unaffected.
//
// 1.3.2+: wildcard-friendly list that covers every common private-
// network range (10.x, 172.16-31.x, 192.168.x) so we don't have to
// edit this file every time the router hands out a different IP
// (e.g. testing from a different Wi-Fi).
allowedDevOrigins: [
'192.168.1.104',
'192.168.1.133',
'192.168.50.196',
'*.local',
'192.168.*.*',
'10.*.*.*',
'172.16.*.*',
'172.17.*.*',
'172.18.*.*',
'172.19.*.*',
'172.20.*.*',
'172.21.*.*',
'172.22.*.*',
'172.23.*.*',
'172.24.*.*',
'172.25.*.*',
'172.26.*.*',
'172.27.*.*',
'172.28.*.*',
'172.29.*.*',
'172.30.*.*',
'172.31.*.*',
],
// Increase body size limit for TUS chunked uploads
// TUS uploads can send chunks larger than 10MB (default Next.js limit)
// Set to 100MB to handle large video chunks safely
experimental: {
serverActions: {
bodySizeLimit: '100mb'
}
},
// 6.5.0: pdfkit reads its standard-font metrics (.afm) from its own package
// directory at runtime. Bundling it into the server build breaks that lookup
// ("ENOENT … Helvetica.afm"), so it must stay an external require. It was
// only used by the worker (plain Node) until the founder PDF report route.
serverExternalPackages: ['pdfkit'],
// 5.0 multi-tenant: `src/lib/org-context.ts` uses Node's `async_hooks`
// (AsyncLocalStorage) and is pulled — via db.ts — into a few CLIENT bundles
// through long import chains (e.g. i18n/locale.ts). Prisma ships a browser
// stub for those chains; `async_hooks` doesn't, so the client compilation
// fails to RESOLVE it. Standard fix: stub the builtin to an empty module in
// browser builds. The code paths never execute client-side (org-context
// also guards instantiation on `typeof window`).
webpack: (config, { isServer }) => {
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
async_hooks: false,
}
}
return config
},
// Security headers are set in src/proxy.ts (nonce-based CSP)
// Static asset headers below cover paths that bypass proxy
async headers() {
return [
{
source: '/:path(brand|favicon|manifest\\.json|robots\\.txt|sw\\.js)/:rest*',
headers: [
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'X-Frame-Options', value: 'DENY' },
{ key: 'Referrer-Policy', value: 'same-origin' },
],
},
]
}
}
module.exports = withNextIntl(nextConfig)