-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
63 lines (60 loc) · 1.71 KB
/
next.config.ts
File metadata and controls
63 lines (60 loc) · 1.71 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
import type { NextConfig } from 'next'
import bundleAnalyzer from '@next/bundle-analyzer'
const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE === 'true'
})
const securityHeaders = [
{
key: 'Content-Security-Policy',
value:
"default-src 'self'; " +
// Allow Vercel Speed Insights scripts
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://va.vercel-scripts.com https://cdn.tiny.cloud; " +
"style-src 'self' 'unsafe-inline' https://cdn.tiny.cloud; " +
"img-src 'self' data: https:; " +
"font-src 'self'; " +
"object-src 'none'; " +
"frame-ancestors 'none'; " +
"base-uri 'self'; " +
"form-action 'self'; " +
// Allow the browser to send the speed data back to Vercel
"connect-src 'self' https://vitals.vercel-insights.com https://cdn.tiny.cloud;"
},
{
key: 'X-Content-Type-Options',
value: 'nosniff'
},
{
key: 'Strict-Transport-Security',
value: 'max-age=63072000; includeSubDomains; preload'
}
]
const nextConfig: NextConfig = {
reactCompiler: true,
headers: async () => {
return [
{
source: '/(.*)',
headers: securityHeaders
}
]
},
allowedDevOrigins: [
'http://localhost:3000',
'http://172.18.160.1:3000',
'https://dev-over-flow-kohl.vercel.app/',
'https://dev-over-flow-n4x8x6lni-fadymas-projects.vercel.app/'
],
poweredByHeader: false,
experimental: {
mdxRs: true
},
images: {
remotePatterns: [
{ protocol: 'https', hostname: 'avatars.githubusercontent.com' },
{ protocol: 'https', hostname: 'lh3.googleusercontent.com' }
]
},
serverExternalPackages: ['mongoose']
}
export default withBundleAnalyzer(nextConfig)