-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
99 lines (97 loc) · 1.93 KB
/
next.config.mjs
File metadata and controls
99 lines (97 loc) · 1.93 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
88
89
90
91
92
93
94
95
96
97
98
99
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
poweredByHeader: false, // Remove X-Powered-By header from response headers for security reasons
productionBrowserSourceMaps: true, // Enable production-ready source maps for better debugging experience
experimental: {
swcPlugins: [["swc-plugin-coverage-instrument", {}]],
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.externals.push({
bufferutil: "bufferutil",
"utf-8-validate": "utf-8-validate",
});
}
if (config.cache) {
config.cache = Object.freeze({
type: "memory",
});
}
return config;
},
images: {
remotePatterns: [
{
protocol: "https",
hostname: "*.amazonaws.com",
port: "",
},
{
protocol: "https",
hostname: "*.cloudfront.net",
port: "",
},
{
protocol: "https",
hostname: "*.chain.site",
port: "",
},
{
protocol: "https",
hostname: "*.kapt.xyz",
port: "",
},
{
protocol: "https",
hostname: "chainsite-storage",
port: "",
},
{
protocol: "https",
hostname: "storage.googleapis.com",
port: "",
},
{
protocol: "https",
hostname: "chainsite-dev-storage",
port: "",
},
],
},
async headers() {
return [
{
// Apply these headers to all routes in your application.
source: "/(.*)",
headers: [
{
key: "X-Frame-Options",
value: "SAMEORIGIN",
},
{
key: "Content-Security-Policy",
value: "frame-ancestors 'none'",
},
{
key: "X-Powered-By",
value: "N/A",
},
{
key: "Referrer-Policy",
value: "strict-origin-when-cross-origin",
},
{
key: "Permissions-Policy",
value: "camera=(), microphone=(), geolocation=()",
},
{
key: "Cache-Control",
value: "public, s-maxage=86400, stale-while-revalidate=3600",
},
],
},
];
},
};
export default nextConfig;