-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
86 lines (81 loc) · 2.17 KB
/
next.config.js
File metadata and controls
86 lines (81 loc) · 2.17 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
const withPlugins = require('next-compose-plugins');
const { createSecureHeaders } = require('next-secure-headers');
const withFonts = require('next-fonts');
const nextConfig = {
eslint: {
ignoreDuringBuilds: true,
},
webpack5: true,
async rewrites() {
return [
{
source: '/sitemap.xml',
destination: '/api/sitemap',
},
{
source: '/rss.xml',
destination: '/api/rss',
},
];
},
images: {
domains: ['s3.us-west-2.amazonaws.com'],
},
async headers() {
return [
{
source: '/(.*)',
headers: createSecureHeaders({
contentSecurityPolicy: {
directives: {
defaultSrc: "'self'",
styleSrc: ["'self'", "'unsafe-inline'"],
imgSrc: [
"'self'",
'data:',
'https://zamiang.imgix.net',
'https://www.googletagmanager.com',
'http://www.googletagmanager.com',
'https://s3.us-west-2.amazonaws.com',
'https://cdn-images-1.medium.com',
'https://vitals.vercel-insights.com',
],
fontSrc: ["'self'"],
scriptSrc: [
"'self'",
"'unsafe-eval'",
"'unsafe-inline'",
'https://www.googletagmanager.com',
'http://www.googletagmanager.com',
'https://platform.twitter.com',
'https://vitals.vercel-insights.com',
],
frameSrc: ['https://platform.twitter.com/', 'https://vitals.vercel-insights.com'],
connectSrc: [
"'self'",
'https://www.googleapis.com',
'https://www.google-analytics.com',
'https://vitals.vercel-insights.com',
],
},
},
forceHTTPSRedirect: true,
referrerPolicy: 'same-origin',
xssProtection: 'block-rendering',
}),
},
];
},
};
module.exports = withPlugins(
[
[
withFonts,
{
reactStrictMode: true,
poweredByHeader: false,
},
],
],
nextConfig,
);