-
Notifications
You must be signed in to change notification settings - Fork 16
/
next.config.js
88 lines (86 loc) · 2.35 KB
/
next.config.js
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
const { i18n } = require("./next-i18next.config");
const securityHeaders = [
{
key: "Content-Security-Policy",
value:
`default-src 'none';` +
`base-uri 'none';` +
`child-src 'self' app.netlify.com;` +
`form-action 'none';` +
`frame-ancestors 'none';` +
`img-src 'self' images.prismic.io assets.coingecko.com s2.coinmarketcap.com *.cloudfront.net data:;` +
`media-src 'self';` +
`object-src 'none';` +
`script-src 'self' ajax.googleapis.com widgets.coingecko.com files.coinmarketcap.com 3rdparty-apis.coinmarketcap.com app.netlify.com netlify-cdp-loader.netlify.app *.googletagmanager.com ${
process.env.NODE_ENV === "development" ? `'unsafe-eval'` : ""
} https://connect.facebook.net;` +
`script-src-elem 'self' ajax.googleapis.com widgets.coingecko.com files.coinmarketcap.com 3rdparty-apis.coinmarketcap.com *.googletagmanager.com;` +
`style-src 'self' fonts.googleapis.com 'unsafe-inline' files.coinmarketcap.com 'unsafe-inline';` +
`font-src 'self' fonts.gstatic.com;` +
`connect-src 'self' api.coingecko.com 3rdparty-apis.coinmarketcap.com wss://cable.coingecko.com ocean.defichain.com api.github.com *.google-analytics.com;`,
},
{
key: "Referrer-Policy",
value: "same-origin",
},
{
key: "X-Content-Type-Options",
value: "nosniff",
},
{
key: "X-Frame-Options",
value: "DENY",
},
{
key: "X-XSS-Protection",
value: "1; mode=block",
},
{
key: "Strict-Transport-Security",
value: "max-age=63072000; includeSubDomains; preload",
},
];
module.exports = {
output: "export",
experimental: {
forceSwcTransforms: true,
},
reactStrictMode: true,
swcMinify: true,
pageExtensions: ["page.tsx", "page.ts"],
async headers() {
return [
{
source: "/(.*)",
headers: securityHeaders,
},
];
},
images: {
domains: ["images.prismic.io"],
},
async redirects() {
return [
{
source: "/learn/:path*",
destination: "/404",
permanent: false,
},
{
source: "/media",
destination: "/404",
permanent: false,
},
{
source: "/bug-bounty",
destination: "/404",
permanent: false,
},
{
source: "/security",
destination: "/404",
permanent: false,
},
];
},
};