-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
53 lines (51 loc) · 1.49 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
/** @type {import('next').NextConfig} */
const path = require("path");
const nextConfig = {
reactStrictMode: true,
images: {
domains: [
"s3.amazonaws.com",
"images.mintkudos.xyz",
"spect.infura-ipfs.io",
"assets.poap.xyz",
],
},
env: {
ALCHEMY_KEY: process.env.ALCHEMY_KEY,
DEV_ENV: process.env.DEV_ENV,
WEB3_STORAGE_TOKEN: process.env.WEB3_STORAGE_TOKEN,
API_HOST: process.env.API_HOST,
BOT_HOST: process.env.BOT_HOST,
MINTKUDOS_HOST: process.env.MINTKUDOS_HOST,
BICONOMY_API_KEY: process.env.BICONOMY_API_KEY,
MIXPANEL_TOKEN: process.env.MIXPANEL_TOKEN,
},
webpack(config, { dev, isServer }) {
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"],
});
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
bufferutil: require.resolve("bufferutil"),
net: require.resolve("net"),
request: require.resolve("request"),
tls: require.resolve("tls"),
"utf-8-validate": require.resolve("utf-8-validate"),
};
if (dev && !isServer) {
const originalEntry = config.entry;
config.entry = async () => {
const wdrPath = path.resolve(__dirname, "./scripts/wdyr.ts");
const entries = await originalEntry();
if (entries["main.js"] && !entries["main.js"].includes(wdrPath)) {
entries["main.js"].push(wdrPath);
}
return entries;
};
}
return config;
},
};
module.exports = nextConfig;