-
Notifications
You must be signed in to change notification settings - Fork 5
/
next.config.js
78 lines (73 loc) · 1.92 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
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
})
const { withSentryConfig } = require("@sentry/nextjs")
const SentryOptions = {
silent: true,
}
/**
* mutable next.js configuration to ensure third party plugins such as bundle
* analyzer and sentry works as intended
*
* @type {import('next').NextConfig} */
let nextConfig = {
reactStrictMode: true,
async headers() {
return [
{
source: "/manifest.json",
headers: [
{
key: "Access-Control-Allow-Origin",
value: "*",
},
{
key: "Access-Control-Allow-Methods",
value: "GET",
},
{
key: "Access-Control-Allow-Headers",
value: "X-Requested-With, content-type, Authorization",
},
],
},
{
source: '/(.*)?', // Matches all pages
headers: [
{
key: 'X-Frame-Options',
value: 'DENY',
}
]
}
]
},
redirects: async () => {
// because aave was using "cellars" not "strategies" we should redirect to handle previous user
return [
{
source: "/cellars/0x7bad5df5e11151dc5ee1a648800057c5c934c0d5",
destination: "/strategies/AAVE",
permanent: true,
basePath: false,
},
{
source: "/strategies",
destination: "/",
permanent: true,
basePath: false,
},
// {
// source: "/strategies/:slug/manage",
// destination: "/strategies/:slug",
// permanent: true,
// basePath: false,
// },
]
},
}
// https://github.com/vercel/next.js/tree/canary/packages/next-bundle-analyzer
nextConfig = withBundleAnalyzer(nextConfig)
// https://github.com/getsentry/sentry-webpack-plugin#options
// nextConfig = withSentryConfig(nextConfig, SentryOptions)
module.exports = nextConfig