-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.ts
79 lines (72 loc) · 1.71 KB
/
next.config.ts
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
import type { NextConfig } from "next";
interface WebpackConfigValue {
resolve?: {
fallback?: Record<string, boolean | string>;
};
optimization?: {
minimize?: boolean;
minimizer?: unknown[];
};
module?: {
rules?: Array<{
test?: RegExp;
use?: Array<{
loader: string;
options?: Record<string, unknown>;
}>;
[key: string]: unknown;
}>;
};
}
const nextConfig: NextConfig = {
images: {
domains: ['assets.coingecko.com', 'coin-images.coingecko.com'],
remotePatterns: [
{
protocol: 'https',
hostname: 'assets.coingecko.com',
pathname: '/coins/images/**',
},
{
protocol: 'https',
hostname: 'coin-images.coingecko.com',
pathname: '/coins/images/**',
}
],
},
webpack: (config: WebpackConfigValue) => {
if (!config.resolve) {
config.resolve = {};
}
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
net: false,
tls: false
};
if (!config.module) {
config.module = { rules: [] };
}
config.module.rules?.push({
test: /\.js$/,
use: [{
loader: 'string-replace-loader',
options: {
search: /[\u0080-\uffff]/g,
replace: (match: string) => '\\u' + match.charCodeAt(0).toString(16).padStart(4, '0')
}
}]
});
return config;
},
experimental: {
optimizePackageImports: ['@web3modal/ethereum', '@web3modal/react']
},
productionBrowserSourceMaps: false,
poweredByHeader: false,
reactStrictMode: true,
env: {
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID || ''
}
};
export default nextConfig;