-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
25 lines (24 loc) · 879 Bytes
/
Copy pathnext.config.js
File metadata and controls
25 lines (24 loc) · 879 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
/** @type {import('next').NextConfig} */
const nextConfig = {
async headers() {
return [
{
// Apply these headers to all routes
source: '/:path*',
headers: [
{
key: 'Content-Security-Policy',
value: process.env.NODE_ENV === 'development' || process.env.TESTING === 'true'
// More permissive policy for development and testing
? "default-src 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:;"
// Stricter policy for production
: "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:;"
}
]
}
];
},
reactStrictMode: true,
swcMinify: true,
};
module.exports = nextConfig;