-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
55 lines (52 loc) · 1.45 KB
/
next.config.mjs
File metadata and controls
55 lines (52 loc) · 1.45 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
/** @type {import('next').NextConfig} */
const isProd = process.env.NEXT_PUBLIC_ENV === 'production';
const nextConfig = {
output: isProd ? 'export' : undefined,
rewrites: isProd ? undefined : async () => {
return [
{
source: '/api/:path*',
destination: 'http://localhost:8000/:path*',
},
{
source: '/auth/:path*',
destination: 'http://localhost:8000/auth/:path*',
},
{
source: '/static/:path*',
destination: 'http://localhost:8000/static/:path*',
},
];
},
trailingSlash: true,
skipTrailingSlashRedirect: true,
distDir: 'out',
images: {
loader: isProd ? 'custom' : 'default',
loaderFile: isProd ? './image-loader.ts' : undefined,
remotePatterns: isProd ? [
{
protocol: "https",
hostname: "**.googleusercontent.com",
},
{
protocol: "https",
hostname: "generated.khoj.dev",
},
{
protocol: "https",
hostname: "assets.khoj.dev",
},
] : [
{
protocol: "https",
hostname: "*"
},
{
protocol: "http",
hostname: "*"
}
]
}
};
export default nextConfig;