forked from grants-stack-frontier/op-rf4-voting-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
56 lines (54 loc) · 1.33 KB
/
next.config.mjs
File metadata and controls
56 lines (54 loc) · 1.33 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
const AGORA_API_URL = process.env.AGORA_API_URL;
const DEFORM_API_URL = 'https://api.deform.cc';
const hostnames = [
'euc.li',
'ens.xyz',
'content.optimism.io',
'cdn.charmverse.io',
'storage.googleapis.com',
'i.imgur.com',
'imagedelivery.net',
'i.seadn.io',
'lh3.googleusercontent.com',
'pbs.twimg.com',
'ipfs.decentralized-content.com',
'icons.llamao.fi',
];
/** @type {import('next').NextConfig} */
const nextConfig = {
env: {
AGORA_API_URL: AGORA_API_URL,
DEFORM_API_URL: DEFORM_API_URL,
},
// https://maxschmitt.me/posts/next-js-api-proxy
// https://nextjs.org/docs/pages/api-reference/next-config-js/rewrites
async rewrites() {
return [
{
source: '/api/agora/:path*',
destination: `${AGORA_API_URL}/:path*`,
},
{
source: '/api/deform/:path*',
destination: `${DEFORM_API_URL}/:path*`,
},
];
},
reactStrictMode: true,
webpack: (config) => {
config.resolve.fallback = { fs: false, net: false, tls: false };
config.externals.push('pino-pretty', 'lokijs', 'encoding', {
'node-gyp-build': 'commonjs node-gyp-build',
});
return config;
},
images: {
remotePatterns: hostnames.map((hostname) => ({
protocol: 'https',
hostname,
port: '',
pathname: '/**',
})),
},
};
export default nextConfig;