-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
113 lines (109 loc) · 3.06 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
* @Author: aelf-lxy
* @Date: 2023-08-02 01:50:01
* @LastEditors: aelf-lxy
* @LastEditTime: 2023-08-02 14:19:21
* @Description: next config
*/
/** @type {import('next').NextConfig} */
// eslint-disable-next-line @typescript-eslint/no-var-requires
const withPlugins = require('next-compose-plugins');
// eslint-disable-next-line @typescript-eslint/no-var-requires
const pluginConfig = require('./build.config/plugin');
const nextConfig = {
compiler: {
// to solve the problem: https://github.com/vercel/next.js/discussions/60150
// https://nextjs.org/docs/architecture/nextjs-compiler#styled-components
styledComponents: {
ssr: true,
},
},
reactStrictMode: false,
experimental: {
proxyTimeout: 300000,
staleTimes: {
dynamic: 1,
static: 1,
},
},
async rewrites() {
return process.env.NODE_ENV === 'production'
? []
: [
{
source: '/home',
destination: '/',
// permanent: false,
},
// {
// source: '/api/:path*',
// destination: 'https://aelfscan.io/api/:path*',
// // permanent: false,
// // basePath: false,
// },
{
source: '/api/:path*',
destination: 'https://testnet.aelfscan.io/api/:path*',
// permanent: false,
// basePath: false,
},
{
source: '/chain/:path*',
destination: 'http://localhost:3001/chain/:path*',
// permanent: false,
},
{
source: '/cms/:path*',
destination: 'http://localhost:3001/cms/:path*',
// permanent: false,
},
{
source: '/new-socket/:path*',
destination: 'http://localhost:3001/new-socket/:path*',
// permanent: false,
},
{
source: '/Portkey_DID/:path*',
destination: 'http://localhost:3001/Portkey_DID/:path*',
// permanent: false,
},
{
source: '/Portkey_V2_DID/:path*',
destination: 'http://localhost:3001/Portkey_V2_DID/:path*',
// permanent: false,
},
// {
// source: '/v1/api/:path*',
// destination: 'http://localhost:3001/v1/api/:path*',
// // permanent: false,
// },
// {
// source: '/v2/api/:path*',
// destination: 'http://localhost:3001/v2/api/:path*',
// // permanent: false,
// },
];
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: '**.amazonaws.com',
},
],
},
productionBrowserSourceMaps: true,
webpack(config, { isServer }) {
config.module.rules.push({
test: /\.proto$/,
use: 'protobufjs-loader',
});
if (!isServer) {
config.devtool = 'source-map';
}
return config;
},
output: 'standalone',
};
// eslint-disable-next-line @typescript-eslint/no-var-requires
module.exports = withPlugins(pluginConfig, nextConfig);