forked from civitai/civitai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
160 lines (155 loc) · 4.15 KB
/
next.config.mjs
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
// @ts-check
import { withAxiom } from "next-axiom";
/**
* Don't be scared of the generics here.
* All they do is to give us autocompletion when using this.
*
* @template {import('next').NextConfig} T
* @param {T} config - A generic parameter that flows through to the return type
* @constraint {{import('next').NextConfig}}
*/
function defineNextConfig(config) {
return config;
}
export default defineNextConfig(withAxiom({
reactStrictMode: true,
// Next.js i18n docs: https://nextjs.org/docs/advanced-features/i18n-routing
i18n: {
locales: ['en'],
defaultLocale: 'en',
},
eslint: {
ignoreDuringBuilds: true,
},
generateEtags: false,
compress: false,
images: {
domains: [
's3.us-west-1.wasabisys.com',
'model-share.s3.us-west-1.wasabisys.com',
'civitai-prod.s3.us-west-1.wasabisys.com',
'civitai-dev.s3.us-west-1.wasabisys.com',
],
},
experimental: {
// scrollRestoration: true,
largePageDataBytes: 512 * 100000,
},
headers: async () => {
// Add X-Robots-Tag header to all pages matching /sitemap.xml and /sitemap-models.xml /sitemap-articles.xml, etc
const headers = [{
source: '/sitemap(-\\w+)?.xml',
headers: [
{ key: 'X-Robots-Tag', value: 'noindex' },
{ key: 'Content-Type', value: 'application/xml' },
{ key: 'Cache-Control', value: 'public, max-age=86400, must-revalidate' }
],
}];
if (process.env.NODE_ENV !== 'production') {
headers.push({
source: '/:path*',
headers: [{
key: 'X-Robots-Tag',
value: 'noindex',
}],
});
}
return headers;
},
poweredByHeader: false,
redirects: async () => {
return [
{
source: '/api/download/training-data/:modelVersionId',
destination: '/api/download/models/:modelVersionId?type=Training%20Data',
permanent: true,
},
{
source: '/github/:path*',
destination: 'https://github.com/civitai/civitai/:path*',
permanent: true,
},
{
source: '/discord',
destination: 'https://discord.gg/civitai',
permanent: true,
},
{
source: '/twitter',
destination: 'https://twitter.com/HelloCivitai',
permanent: true,
},
{
source: '/reddit',
destination: 'https://reddit.com/r/civitai',
permanent: true,
},
{
source: '/instagram',
destination: 'https://www.instagram.com/hellocivitai/',
permanent: true,
},
{
source: '/tiktok',
destination: 'https://www.tiktok.com/@hellocivitai',
permanent: true,
},
{
source: '/youtube',
destination: 'https://www.youtube.com/@civitai',
permanent: true,
},
{
source: '/ideas',
destination: 'https://github.com/civitai/civitai/discussions/categories/ideas',
permanent: true,
},
{
source: '/v/civitai-link-intro',
destination: 'https://youtu.be/MaSRXvM05x4',
permanent: false,
},
{
source: '/v/civitai-link-installation',
destination: 'https://youtu.be/fs-Zs-fvxb0',
permanent: false,
},
{
source: '/gallery/:path*',
destination: '/images/:path*',
permanent: true,
},
{
source: '/appeal',
destination: 'https://forms.clickup.com/8459928/f/825mr-5844/5NXSA2EIT3YOS2JSF7',
permanent: true,
},
{
source: '/canny/feedback',
destination: 'https://feedback.civitai.com/?b=feature-request',
permanent: true,
},
{
source: '/feedback',
destination: 'https://feedback.civitai.com/?b=feature-request',
permanent: true,
},
{
source: '/canny/bugs',
destination: 'https://feedback.civitai.com/?b=bug',
permanent: true,
},
{
source: '/bugs',
destination: 'https://feedback.civitai.com/?b=bug',
permanent: true,
},
{
source: '/leaderboard',
destination: '/leaderboard/overall',
permanent: true,
}
];
},
output: 'standalone',
}));