-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
99 lines (87 loc) · 2.77 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
/** @type {import('next').NextConfig} */
// const fs = require('fs');
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0
global.DEVMODE = process.env.DEVMODE?.toString()?.trim()?.toLowerCase()?.includes("true");
global.BUILDMODE = process.env.BUILDMODE?.toString()?.trim()?.toLowerCase() == "true";
global.nodeenv = process.env.NODE_ENV
global.devmode = global.DEVMODE || process.env.NODE_ENV == "development" || process.env.NODE_ENV == "test"
const nextConfig = {
// output: "standalone",
images: {
disableStaticImages: true,
unoptimized: true,
},
// images: {
// minimumCacheTTL: 360000,
// domains:
// [
// process.env.DOMAIN,
// "gravatar.com",
// "qepal.com",
// 'lh3.googleusercontent.com',
// "cdn0.qepal.com", "cdn1.qepal.com", "cdn2.qepal.com", "cdn3.qepal.com", "cdn4.qepal.com", "cdn5.qepal.com",
// ],
// },
rewrites: async () => {
return [
{
source: '/robots.txt',
destination: '/api/robots'
},
{
source: '/cert/:path*',
destination: '/api/cert/:path*'
},
{
source: '/cl/:path*',
destination: '/fa/workspace/challenge/:path*'
},
{
source: '/sitemap.xml',
destination: '/api/sitemap'
},
{
source: '/:lang(ch)/:path*',
destination: '/en/:path*?lang=:lang',
},
];
},
async headers() {
return [
{
source: '/:all*(svg|jpg|png|mp4|webp)',
locale: false,
headers: [
{
key: 'Cache-Control',
// value: 'public, max-age=0, must-revalidate',
value: 'public, max-age=9999999999, must-revalidate',
}
],
},
{
source: "/(.*?)",
locale: false,
headers: [
{
key: "referrerpolicy",
value: "no-referrer"
},
{
key: 'Access-Control-Allow-Origin',
value: '*'
},
{
key: 'Access-Control-Allow-Headers',
value: '*'
},
{
key: 'Access-Control-Allow-Methods',
value: '*'
},
],
},
]
},
};
export default nextConfig;