-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.mjs
44 lines (40 loc) · 946 Bytes
/
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
/** @type {import('next').NextConfig} */
const nextConfig = {
basePath: '',
pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'],
images: {
formats: ['image/avif', 'image/webp'],
},
compiler: {
styledComponents: true,
},
output: 'standalone',
headers: async () => {
return [
{
source: '/(.*)',
headers: SecurityHeaders,
},
];
},
};
const ContentSecurityPolicy = `
default-src 'self' 'unsafe-inline' 'unsafe-eval';
style-src 'self' 'unsafe-inline' https://fonts.googleapis.com;
font-src 'self' data: https://fonts.gstatic.com;
script-src 'self' 'unsafe-eval' 'unsafe-inline';
img-src * blob: data:;
media-src 'none';
connect-src *;
`;
const SecurityHeaders = [
{
key: 'Content-Security-Policy',
value: ContentSecurityPolicy.replace(/\n/g, ''),
},
{
key: 'X-Requested-With',
value: 'XMLHttpRequest',
},
];
export default nextConfig;