-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
38 lines (29 loc) · 904 Bytes
/
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
const { ProxyAgent, setGlobalDispatcher } = require("undici");
// If running `yarn dev-mitm`, then setup the proxy with MITMPROXY_ADDRESS
// NOTE(FIXME): not all madatdata requests get sent through here for some reason
const setupProxy = () => {
if (!process.env.MITMPROXY_ADDRESS) {
return;
}
const MITM = process.env.MITMPROXY_ADDRESS;
console.log("MITM SETUP:", MITM);
if (!process.env.GLOBAL_AGENT_HTTP_PROXY) {
process.env["GLOBAL_AGENT_HTTP_PROXY"] = MITM;
}
process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = "0";
const mitmProxyOpts = {
uri: MITM,
connect: {
rejectUnauthorized: false,
requestCert: false,
},
};
setGlobalDispatcher(new ProxyAgent(mitmProxyOpts));
};
setupProxy();
module.exports = {
typescript: {
// Just use TypeScript for development/IDE purposes and ignore some errors for now
ignoreBuildErrors: true,
},
};