-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
33 lines (30 loc) · 928 Bytes
/
Copy pathnext.config.js
File metadata and controls
33 lines (30 loc) · 928 Bytes
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
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
async headers() {
// Apply CSP only in production to avoid blocking dev scripts
if (process.env.NODE_ENV !== "production") return []
return [
{
source: "/(.*)",
headers: [
{
key: "Content-Security-Policy",
value:
"default-src 'none'; " +
"img-src 'self' https://camo.githubusercontent.com data:; " +
"script-src-elem 'sha256-ZswfTY7H35rbv8WC7NXBoiC7WNu86vSzCDChNWwZZDM=' " +
"'sha256-yei5Fza+Eyx4G0smvN0xBqEesIKumz6RSyGsU3FJowI='; " +
"style-src 'self' 'unsafe-inline';",
},
{
key: "Cache-Control",
value: "public, max-age=86400, stale-while-revalidate=86400",
},
],
},
]
},
}
module.exports = nextConfig