-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
58 lines (52 loc) · 1.58 KB
/
next.config.js
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
import fs from "fs";
const safeStylesheet = [].join(" ");
const safeScripts = ["*.googletagmanager.com"].join(" ");
const contentSecurityPolicy = `style-src 'self' 'unsafe-eval' 'unsafe-inline' ${safeStylesheet}; script-src 'self' ${safeScripts} 'unsafe-eval' 'unsafe-inline';`;
export function redirects() {
try {
const redirectsFile = fs.readFileSync("./src/redirects.json", "utf8");
return JSON.parse(redirectsFile);
} catch (error) {
return [];
}
}
const config = {
reactStrictMode: true,
swcMinify: true,
images: {
minimumCacheTTL: 60
},
async redirects() {
return redirects();
},
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "X-Frame-Options",
value: "DENY"
},
{
key: "Content-Security-Policy",
value: contentSecurityPolicy
},
{
key: "X-Content-Type-Options",
value: "nosniff"
},
{
key: "Permissions-Policy",
value: "camera=(), battery=(self), geolocation=(), microphone=()"
},
{
key: "Referrer-Policy",
value: "origin-when-cross-origin"
}
]
}
];
}
};
export default config;