forked from dappforce/grillchat
-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
106 lines (100 loc) · 2.46 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
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
const runtimeCaching = require('./cache')
const withPWA = require('next-pwa')({
dest: 'public',
disable: process.env.NODE_ENV !== 'production',
buildExcludes: [/chunks\/.*$/, /media\/.*$/],
publicExcludes: ['!splashscreens/**/*', '!screenshots/**/*'],
runtimeCaching,
})
/** @type {import('next').NextConfig} */
const nextConfig = {
basePath: process.env.NEXT_PUBLIC_BASE_PATH || undefined,
reactStrictMode: true,
experimental: {
scrollRestoration: true,
largePageDataBytes: 200 * 1024, // 200kb
},
transpilePackages: ['react-tweet'],
webpack(config) {
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: ['@svgr/webpack'],
})
config.module.rules.push({
test: /\.md$/,
use: ['html-loader', 'markdown-loader'],
})
return config
},
async rewrites() {
return [
{ source: '/hubs', destination: '/' },
{ source: '/my-chats', destination: '/' },
{ source: '/hot-chats', destination: '/' },
{ source: '/ask', destination: '/featured/54469' },
{ source: '/discuss', destination: '/featured/54469' },
]
},
async redirects() {
if (process.env.NEXT_PUBLIC_IS_MAINTENANCE === 'true') {
return [
{
source: '/((?!maintenance).*)',
destination: '/maintenance',
permanent: false,
},
]
}
return [
{
source: '/maintenance',
destination: '/tg',
permanent: false,
},
{
source: '/report',
destination: 'https://forms.gle/Gjh3ELaNHTBotiwN7',
permanent: false,
},
{
source: '/appeal',
destination: 'https://forms.gle/nKjNwentimo2f6Yi6',
permanent: false,
},
{
source: '/guide',
destination: 'https://paragraph.xyz/@epic/guide',
permanent: false,
},
]
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'ipfs.subsocial.network',
port: '',
pathname: '/ipfs/**',
},
{
protocol: 'https',
hostname: 'miro.medium.com',
port: '',
},
{
protocol: 'https',
hostname: 'metadata.ens.domains',
port: '',
},
{
protocol: 'https',
hostname: '**',
},
],
},
}
module.exports = withPWA(withBundleAnalyzer(nextConfig))