forked from talentprotocol/creator-score-miniapp
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnext.config.mjs
More file actions
90 lines (88 loc) · 3.51 KB
/
next.config.mjs
File metadata and controls
90 lines (88 loc) · 3.51 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
87
88
89
90
/** @type {import('next').NextConfig} */
const nextConfig = {
// reactStrictMode: false, // TODO: Uncomment this to test duplicated requests
// Silence warnings
// https://github.com/WalletConnect/walletconnect-monorepo/issues/1908
webpack: (config) => {
config.externals.push("pino-pretty", "lokijs", "encoding");
// Exclude HeartbeatWorker from Terser minification
if (config.optimization && Array.isArray(config.optimization.minimizer)) {
config.optimization.minimizer.forEach((minimizer) => {
if (
minimizer.constructor.name === "TerserPlugin" &&
minimizer.options &&
minimizer.options.exclude !== undefined
) {
if (Array.isArray(minimizer.options.exclude)) {
minimizer.options.exclude.push(/HeartbeatWorker\..*\.js$/);
} else {
minimizer.options.exclude = [
minimizer.options.exclude,
/HeartbeatWorker\..*\.js$/,
].filter(Boolean);
}
}
});
}
return config;
},
images: {
domains: [
"api.dicebear.com",
"i.imgur.com",
"imagedelivery.net",
"www.base200.com",
"base200.com",
],
},
transpilePackages: ["@coinbase/wallet-sdk", "@coinbase/onchainkit"],
async rewrites() {
return [
{
source: "/ingest/static/:path*",
destination: "https://eu-assets.i.posthog.com/static/:path*",
},
{
source: "/ingest/:path*",
destination: "https://eu.i.posthog.com/:path*",
},
{
source: "/ingest/decide",
destination: "https://eu.i.posthog.com/decide",
},
];
},
// This is required to support PostHog trailing slash API requests
skipTrailingSlashRedirect: true,
// This is required to support Privy
async headers() {
return [
{
source: "/:path*",
headers: [
{
key: "Content-Security-Policy",
value: `
script-src 'self' 'unsafe-inline' 'unsafe-eval' https://challenges.cloudflare.com https://vercel.live;
style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://use.typekit.net https://p.typekit.net;
style-src-elem 'self' 'unsafe-inline' https://fonts.googleapis.com https://use.typekit.net https://p.typekit.net;
font-src 'self' https://fonts.gstatic.com https://use.typekit.net https://p.typekit.net;
object-src 'none';
base-uri 'self';
form-action 'self';
frame-ancestors 'self' https://www.base200.com https://base200.com https://warpcast.com https://*.warpcast.com https://farcaster.xyz https://*.farcaster.xyz;
child-src https://auth.privy.io https://verify.walletconnect.com https://verify.walletconnect.org;
frame-src https://auth.privy.io https://verify.walletconnect.com https://verify.walletconnect.org https://challenges.cloudflare.com;
connect-src 'self' https://www.base200.com https://base200.com https://auth.privy.io wss://relay.walletconnect.com wss://relay.walletconnect.org wss://www.walletlink.org https://*.rpc.privy.systems https://*.walletconnect.com https://pulse.walletconnect.org https://api.web3modal.org https://warpcast.com https://client.warpcast.com https://api.coinbase.com https://vercel.live;
worker-src 'self';
manifest-src 'self'
`
.replace(/\s+/g, " ")
.trim(),
},
],
},
];
},
};
export default nextConfig;