-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
87 lines (82 loc) · 2.66 KB
/
next.config.mjs
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
import { withSentryConfig } from "@sentry/nextjs";
const cspHeader = `
default-src 'self';
script-src 'self' www.googletagmanager.com 'unsafe-inline' beacon-v2.helpscout.net;
style-src 'self' 'unsafe-inline' fonts.googleapis.com;
img-src 'self' blob: data: cdn.zerion.io assets.ref.finance https://api.web3modal.org;
font-src 'self' fonts.gstatic.com;
object-src 'none';
base-uri 'self';
form-action 'self';
worker-src 'self' blob:;
frame-ancestors 'self' *.walletconnect.com *.walletconnect.org;
connect-src 'self' d3hb14vkzrxvla.cloudfront.net beaconapi.helpscout.net chatapi.helpscout.net *.near.org *.ref-finance.com *.ref.finance *.aurora.dev api.web3modal.com *.walletconnect.org *.walletconnect.com *.sentry.io wss://relay.walletconnect.com wss://relay.walletconnect.org *.walletlink.org wss://www.walletlink.org *.coinbase.com https://rpc.testnet.near.org https://closerpc.aurora.dev https://api.web3modal.org www.googletagmanager.com *.google-analytics.com https://h4n.app https://*.peersyst.tech;
frame-src *.walletconnect.org *.walletconnect.com https://my.herewallet.app https://*.peersyst.tech/;
`;
/** @type {import('next').NextConfig} */
const nextConfig = {
env: {
// REF WIDGET NETWORK CONFIG
NEAR_ENV: process.env.nearEnv,
nearEnv: process.env.nearEnv,
explorerUrl: process.env.explorerUrl,
walletExplorerUrl: process.env.walletExplorerUrl,
ethRpcForNear: process.env.ethRpcForNear,
nearNativeRpc: process.env.nearNativeRpc,
chainId: process.env.chainId,
WC_PROJECT_ID: process.env.WC_PROJECT_ID,
},
images: {
remotePatterns: [
{
protocol: "https",
hostname: "dashboard-assets.dappradar.com",
},
],
},
webpack: (config) => {
config.module.rules.push({
test: /\.svg$/i,
use: ["@svgr/webpack"],
});
config.resolve = {
...config.resolve,
fallback: {
fs: false,
path: false,
os: false,
},
};
return config;
},
headers: async () => {
if (!process.env.NEXT_PUBLIC_VERCEL_ENV) return [];
return [
{
source: "/(.*)",
headers: [
{
key: "Content-Security-Policy",
value: cspHeader.replace(/\n/g, ""),
},
],
},
];
},
rewrites: async () => [
{
source: "/.well-known/walletconnect.txt",
destination: "/api/wc/verify",
},
],
};
const sentryConfig = {
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
silent: true,
widenClientFileUpload: true,
hideSourceMaps: true,
disableLogger: true,
tunnelRoute: "/monitoring-tunnel",
};
export default withSentryConfig(nextConfig, sentryConfig);