-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
112 lines (110 loc) · 2.52 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
/** @type {import('next').NextConfig} **/
const nextConfig = {
async redirects() {
return [
{
source: '/topics/:slug*',
destination: '/story/:slug*',
permanent: true,
},
]
},
async rewrites() {
return [
{
source: '/sitemap_index.xml.gz',
destination: 'https://api.infold.ai/sitemap_index.xml.gz'
},
{
source: '/story/sitemap.xml.gz',
destination: 'https://api.infold.ai/topics/sitemap.xml.gz'
},
{
source: '/keyword/sitemap.xml.gz',
destination: 'https://api.infold.ai/keywords/sitemap.xml.gz'
},
{
source: '/sitemap_index.xml',
destination: 'https://api.infold.ai/sitemap_index.xml'
},
{
source: '/story/sitemap.xml',
destination: 'https://api.infold.ai/topics/sitemap.xml'
},
{
source: '/keyword/sitemap.xml',
destination: 'https://api.infold.ai/keywords/sitemap.xml'
},
{
source: '/robots.txt',
destination: 'https://api.infold.ai/robots.txt'
}
]
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'upload.wikimedia.org',
port: '',
pathname: '/wikipedia/commons/**',
},
{
protocol: 'https',
hostname: 'pbs.twimg.com',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'img.freepik.com',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'cdn.shopify.com',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'dev-to-uploads.s3.amazonaws.com',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'i.ytimg.com',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'substackcdn.com',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'm.media-amazon.com',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'images-eu.ssl-images-amazon.com',
port: '',
pathname: '/**',
}
],
},
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
config.externals.push({
'utf-8-validate': 'commonjs utf-8-validate',
'bufferutil': 'commonjs bufferutil',
})
return config
},
}
module.exports = nextConfig