forked from DefiLlama/defillama-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
112 lines (108 loc) · 2.46 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// This file sets a custom webpack configuration to use your Next.js app
// with Sentry.
// https://nextjs.org/docs/api-reference/next.config.js/introduction
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
const { withSentryConfig } = require('@sentry/nextjs')
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true'
})
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
async redirects() {
return [
{
source: '/home',
destination: '/',
permanent: true
},
{
source: '/chain/Binance',
destination: '/chain/BSC',
permanent: true
},
{
source: '/langs',
destination: '/languages',
permanent: true
},
{
source: '/yields/project/:path*',
destination: '/yields?project=:path*',
permanent: true
},
{
source: '/yields/token/:path*',
destination: '/yields?token=:path*',
permanent: true
},
{
source: '/yields/chain/:path*',
destination: '/yields?chain=:path*',
permanent: true
},
{
source: '/recent-noforks',
destination: '/recent',
permanent: true
},
{
source: '/liquidations',
destination: '/liquidations/eth',
permanent: false
},
{
source: '/yields/optimizer',
destination: '/borrow',
permanent: true
},
{
source: '/aggregator',
destination: 'https://swap.defillama.com/',
permanent: true
},
{
source: '/protocols/cex',
destination: '/cexs',
permanent: true
},
{
source: '/yields/borrow',
destination: '/yields',
permanent: true
}
]
},
async headers() {
return [
{
source: '/chart/:slug*', // Matches all /chart pages
headers: [
{
key: 'X-Frame-Options',
value: 'SAMEORIGIN'
},
{ key: 'Content-Security-Policy', value: 'frame-ancestors https:' }
]
}
]
},
images: {
domains: ['icons.llama.fi', 'assets.coingecko.com', 'yield-charts.llama.fi', 'icons.llamao.fi']
},
compiler: {
styledComponents: true
},
generateBuildId: async () => {
// get the latest git commit hash here
const commitHash = require('child_process').execSync('git rev-parse HEAD').toString().trim()
return commitHash
},
experimental: {
largePageDataBytes: 6_000_000
}
}
module.exports = withBundleAnalyzer(nextConfig)
// if (process.env.SENTRY_DSN) {
// module.exports = withSentryConfig(module.exports, { silent: true }, { hideSourceMaps: true })
// }