-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.mjs
105 lines (103 loc) · 2.73 KB
/
next.config.mjs
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/** @type {import('next').NextConfig} */
import { withContentlayer } from 'next-contentlayer2';
import { resolve } from 'path';
export default withContentlayer({
compress: true,
reactStrictMode: false,
cacheHandler: resolve('./src/lib/cache.js'),
cacheMaxMemorySize: 0,
experimental: {
turbo: {
rules: {
'*.sass': {
loaders: ['sass-loader'],
options: {
implementation: import('sass')
}
}
},
resolveImports: true
},
optimizePackageImports: ['cobe'],
optimisticClientCache: true
},
images: {
dangerouslyAllowSVG: true,
deviceSizes: [320, 420, 768, 1024, 1200, 1920],
remotePatterns: [
{
protocol: "https",
hostname: "cordximg.host"
},
{
protocol: "https",
hostname: "user-images.trustpilot.com"
},
{
protocol: "https",
hostname: "source.unsplash.com"
},
{
protocol: "https",
hostname: "toxicdev.me"
}
]
},
sassOptions: {
silenceDeprecations: ['legacy-js-api'],
silenceDeprecationWarnings: true,
silenceWarnings: true,
},
env: {
API_URL: process.env.API_URL,
API_SHORT_URL: process.env.API_SHORT_URL,
API_IDENTIFIER: process.env.API_IDENTIFIER,
API_SECRET: process.env.API_SECRET,
NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET,
HETRIX_API_KEY: process.env.HETRIX_API_KEY,
GITHUB_API_URL: process.env.GITHUB_API_URL,
GITHUB_PAT: process.env.GITHUB_PAT,
ERROR_HOOK_ID: process.env.ERROR_HOOK_ID,
ERROR_HOOK_TOKEN: process.env.ERROR_HOOK_TOKEN,
TAWK_TO_EMBED_URL: process.env.TAWK_TO_EMBED_URL,
UR_API_KEY: process.env.UR_API_KEY,
},
async headers() {
return [
{
source: '/:path*',
headers: securityHeaders
}
]
}
})
const securityHeaders = [
{
key: 'X-Powered-By',
value: 'NodeByte LTD'
},
{
key: 'Powered-By',
value: 'NodeByte LTD'
},
{
key: 'X-Content-Type-Options',
value: 'nosniff'
},
{
key: 'X-Frame-Options',
value: 'DENY'
},
{
key: 'X-XSS-Protection',
value: '1; mode=block'
},
{
key: 'Strict-Transport-Security',
value: 'max-age=63072000; includeSubDomains; preload'
},
{
key: 'Referrer-Policy',
value: 'origin-when-cross-origin'
},
]