This repository was archived by the owner on Apr 8, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathnext.config.ts
More file actions
129 lines (117 loc) · 2.81 KB
/
next.config.ts
File metadata and controls
129 lines (117 loc) · 2.81 KB
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
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
reactStrictMode: true,
async rewrites() {
return [
{
source: '/launcher/:path*',
destination: '/launcher/:path*',
},
{
source: '/avatar/:path*',
destination: '/api/avatar/:path*',
},
{
source: '/items-icons/:path*',
destination: '/api/items-icons/:path*',
},
{
source: '/games-icons/:path*',
destination: '/api/games-icons/:path*',
},
{
source: '/banners-icons/:path*',
destination: '/api/banners-icons/:path*',
},
{
source: '/launcher',
destination: '/launcher/home',
},
{
source: '/upload/avatar',
destination: '/api/upload/avatar',
},
{
source: '/upload/banner',
destination: '/api/upload/banner',
},
{
source: '/upload/game-icon',
destination: '/api/upload/game-icon',
},
{
source: '/upload/item-icon',
destination: '/api/upload/item-icon',
},
{
source: '/join-lobby',
destination: '/join-lobby.html',
},
{
source: '/api-key',
destination: '/api/api-key',
},
// Removed external rewrite for Cloudflare compatibility
];
},
async headers() {
return [
{
source: '/api/:path*',
headers: [
{
key: 'X-Real-IP',
value: 'true',
},
],
},
{
source: '/oauth2/auth',
headers: [
{
key: 'Access-Control-Allow-Origin',
value: '*',
},
{
key: 'X-Frame-Options',
value: 'ALLOWALL',
},
{
key: 'Content-Security-Policy',
value: 'frame-ancestors *',
},
{
key: 'Referrer-Policy',
value: 'no-referrer',
},
],
},
];
},
eslint: {
ignoreDuringBuilds: true,
},
images: {
unoptimized: true,
},
typescript: {
ignoreBuildErrors: true
},
experimental: {
optimizeCss: false,
},
webpack: (config, { isServer }) => {
// Redirect next-i18next imports to our compatibility layer
config.resolve.alias = {
...config.resolve.alias,
'next-i18next': require.resolve('./next-i18next.js'),
'next-i18next/serverSideTranslations': require.resolve('./next-i18next.js'),
};
return config;
},
// Remove i18n config for Cloudflare compatibility - handle it manually
};
export default nextConfig;
// added by create cloudflare to enable calling `getCloudflareContext()` in `next dev`
import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare';
initOpenNextCloudflareForDev();