-
Notifications
You must be signed in to change notification settings - Fork 34
/
next.config.mjs
59 lines (54 loc) · 1.54 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
import { CHAINS } from '@lido-sdk/constants';
import buildDynamics from './scripts/build-dynamics.mjs';
buildDynamics();
const basePath = process.env.BASE_PATH || '';
const infuraApiKey = process.env.INFURA_API_KEY;
const alchemyApiKey = process.env.ALCHEMY_API_KEY;
const apiProviderUrls = {
[CHAINS.Mainnet]: process.env[`API_PROVIDER_URL_${CHAINS.Mainnet}`],
[CHAINS.Ropsten]: process.env[`API_PROVIDER_URL_${CHAINS.Ropsten}`],
[CHAINS.Rinkeby]: process.env[`API_PROVIDER_URL_${CHAINS.Rinkeby}`],
[CHAINS.Goerli]: process.env[`API_PROVIDER_URL_${CHAINS.Goerli}`],
[CHAINS.Kovan]: process.env[`API_PROVIDER_URL_${CHAINS.Kovan}`],
};
const cspTrustedHosts = process.env.CSP_TRUSTED_HOSTS;
const cspReportOnly = process.env.CSP_REPORT_ONLY;
const cspReportUri = process.env.CSP_REPORT_URI;
export default {
basePath,
eslint: {
ignoreDuringBuilds: true,
},
compiler: {
styledComponents: true,
},
// WARNING: Vulnerability fix, don't remove until default Next.js image loader is patched
images: {
loader: 'custom',
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack', 'url-loader'],
});
return config;
},
async headers() {
return [
{
// required for gnosis save apps
source: '/manifest.json',
headers: [{ key: 'Access-Control-Allow-Origin', value: '*' }],
},
];
},
serverRuntimeConfig: {
basePath,
infuraApiKey,
alchemyApiKey,
apiProviderUrls,
cspTrustedHosts,
cspReportOnly,
cspReportUri,
},
};