-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathnext.config.js
More file actions
86 lines (83 loc) · 1.89 KB
/
next.config.js
File metadata and controls
86 lines (83 loc) · 1.89 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
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'assets.leapwallet.io',
},
{
protocol: 'https',
hostname: 'raw.githubusercontent.com',
},
{
protocol: 'https',
hostname: 'xdefi-static.s3.eu-west-1.amazonaws.com',
},
{
protocol: 'https',
hostname: 'i.stargaze-apis.com',
},
{
protocol: 'https',
hostname: 'ichef.bbci.co.uk',
},
],
},
async headers() {
return [
{
source: '/(.*)?',
headers: [
{
key: 'Referrer-Policy',
value: 'origin-when-cross-origin',
},
{
key: 'Cache-Control',
value: 'public, max-age=600, s-maxage=600, must-revalidate',
},
{
key: 'CDN-Cache-Control',
value: 'public, max-age=600, s-maxage=600, must-revalidate',
},
{
key: 'Expires',
value: '01',
},
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
],
},
]
},
async rewrites() {
return [
// Rewrite frontend routes for non-bot user agents (excluding API routes)
{
source: '/((?!api|_next|favicon).*)',
destination: '/',
has: [
{
type: 'header',
key: 'User-Agent',
value:
'(^(?!facebook|twitter|linkedin|telegram|discord|bot|crawl|spider|facebookexternalhit|Facebot|Twitterbot|TelegramBot|XtilesBot).*$)',
},
],
},
]
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: ['@svgr/webpack'],
})
return config
},
}
module.exports = nextConfig