-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
77 lines (76 loc) · 1.77 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
const { GRAPHQL_URL, localeSegment, PUBLIC_BASE_URL } = require('./constants')
const {
ASSETS_SERVER_SOURCE_BASE_URL
} = process.env
module.exports = {
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
images: {
domains: ['cms.lobbywatch.ch'],
},
async rewrites() {
return [
{
source: '/',
destination: '/api/language',
},
{
source: '/graphql',
destination: GRAPHQL_URL,
},
ASSETS_SERVER_SOURCE_BASE_URL && {
source: '/assets/:path*',
destination: `${ASSETS_SERVER_SOURCE_BASE_URL}/:path*`,
},
].filter(Boolean)
},
async redirects() {
return [
PUBLIC_BASE_URL && {
source: '/:path*',
missing: [
{
type: 'host',
value: new URL(PUBLIC_BASE_URL).hostname,
},
{
type: 'header',
key: 'X-Forwarded-Host',
value: new URL(PUBLIC_BASE_URL).hostname,
},
],
permanent: true,
destination: `${PUBLIC_BASE_URL}/:path*`,
},
{
source: `/${localeSegment}/search/daten`,
destination: '/:locale/search',
permanent: true,
},
{
source: `/${localeSegment}/search/daten/:term`,
destination: '/:locale/search?term=:term',
permanent: true,
},
{
source: '/graphiql',
destination: GRAPHQL_URL.replace('/graphql', '/graphiql'),
permanent: false,
},
{
source: '/angebote',
destination: '/de/patronage',
permanent: false,
},
].filter(Boolean)
},
poweredByHeader: false,
useFileSystemPublicRoutes: true,
experimental: {
largePageDataBytes: 512 * 1000, // 512KB
},
}