-
Notifications
You must be signed in to change notification settings - Fork 15
/
next.config.js
94 lines (89 loc) · 2.22 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
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'],
})
return config
},
async rewrites() {
return [
{ source: '/hubs', destination: '/' },
{ source: '/my-chats', destination: '/' },
{ source: '/hot-chats', destination: '/' },
// { source: '/ai-bots', destination: '/' },
{ source: '/creators', destination: '/' },
{ source: '/ask', destination: '/featured/54469' },
{ source: '/discuss', destination: '/featured/54469' },
]
},
async redirects() {
return [
{
source: '/x',
destination: '/',
permanent: false,
},
{
source: '/:hubId/c/:slug',
destination: '/:hubId/:slug',
permanent: false,
},
{
source: '/report',
destination: 'https://grillapp.net/c/subsocial/177594',
permanent: false,
},
{
source: '/appeal',
destination: 'https://forms.gle/nKjNwentimo2f6Yi6',
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))