-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
81 lines (73 loc) · 1.57 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
79
80
81
const {
CLIENT_URL,
BACKEND_API,
STATIC_DOMAIN,
IS_PROD,
ENVIRONMENT,
SENTRY_DSN,
NETWORKS,
EXPLORER_URLS,
API_URLS,
DEFAULT_NETWORK,
EXCHANGE_API,
IMGIX_URL,
DEFAULT_WEB3_URL,
MONA_TOKEN_ADDRESSES,
DIGITAL_MARKETPLACE_ADDRESSES,
ACCESS_CONTROL_ADDRESSES,
DTX_ADDRESSES,
EIP721_URL,
NIX_URL
} = require('config');
const withImages = require('next-images');
const webpack = require('webpack')
const env = {
PINATA_API_KEY: process.env.PINATA_API_KEY,
PINATA_API_SECRET_KEY: process.env.PINATA_API_SECRET_KEY,
INFURA_API_KEY: process.env.INFURA_API_KEY
};
module.exports = withImages({
publicRuntimeConfig: {
BACKEND_API,
STATIC_DOMAIN,
CLIENT_URL,
IS_PROD,
ENVIRONMENT,
SENTRY_DSN,
NETWORKS,
EXPLORER_URLS,
API_URLS,
DEFAULT_NETWORK,
EXCHANGE_API,
IMGIX_URL,
DEFAULT_WEB3_URL,
MONA_TOKEN_ADDRESSES,
DIGITAL_MARKETPLACE_ADDRESSES,
ACCESS_CONTROL_ADDRESSES,
DTX_ADDRESSES,
EIP721_URL,
NIX_URL
},
trailingSlash: true,
assetPrefix: './',
images: {
domains: ['digitalax.mypinata.cloud'],
},
webpack(cfg, { isServer }) {
const originalEntry = cfg.entry;
cfg.entry = async () => {
const entries = await originalEntry();
if (entries['main.js'] && !entries['main.js'].includes('./polyfills.js')) {
entries['main.js'].unshift('./polyfills.js');
}
return entries;
};
if (!isServer) {
cfg.node = {
ws: 'empty',
};
}
cfg.plugins.push(new webpack.EnvironmentPlugin(env))
return cfg;
},
});