-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
60 lines (56 loc) · 1.54 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
const withBundleAnalyzer = require('next-bundle-analyzer')({ enabled: process.env.ANALYZE === 'true' });
const withNextIntl = require('next-intl/plugin')();
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
productionBrowserSourceMaps: true,
experimental: {
// Optimize client-side code
optimizePackageImports: ['@heroicons/react'],
},
compiler: {
// Optimize client bundle
removeConsole: process.env.NODE_ENV === 'production',
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'vechain.github.io',
pathname: '/token-registry/assets/**',
},
{
protocol: 'https',
hostname: 'vechain.github.io',
pathname: '/nft-registry/assets/**',
},
],
},
modularizeImports: {
'@heroicons/react/24/outline': {
transform: '@heroicons/react/24/outline/{{member}}',
},
'@heroicons/react/24/solid': {
transform: '@heroicons/react/24/solid/{{member}}',
},
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
path: false,
crypto: false,
'pino-pretty': false,
};
}
config.externals = [...(config.externals || []), 'pino-pretty', 'rate-limiter-flexible'];
config.module.rules.push({
test: /rate-limiter-flexible/,
use: 'null-loader'
});
return config;
},
};
// Apply plugins
module.exports = withNextIntl(withBundleAnalyzer(nextConfig));