-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
61 lines (58 loc) · 1.19 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
const subdomains = [
{ domain: 'where.is', path: '/where' },
{ domain: 'who.is', path: '/about' },
{ domain: 'pay', path: '/pay' },
]
const config = {
experimental: {
serverComponentsExternalPackages: ['canvas'],
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
loader: 'svg-inline-loader',
})
return config
},
images: {
domains: ['images.weserv.nl', 'backend.grant.codes'],
},
async rewrites() {
return {
beforeFiles: subdomains.map((d) => ({
source: '/',
has: [
{
type: 'host',
value: `${d.domain}.grant.codes`,
},
],
destination: `https://grant.codes/${d.path}/`,
basePath: false,
})),
}
},
async redirects() {
return [
{
source: '/.well-known/:wellknown*',
destination: 'https://fed.brid.gy/.well-known/:wellknown*',
permanent: false,
},
]
},
async headers() {
return [
{
source: '/fonts/(.*)',
headers: [
{
key: 'Access-Control-Allow-Origin',
value: '*',
},
],
},
]
},
}
export default config