2024-06-22 14:42:41 +00:00
|
|
|
/** @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:42110/api/:path*',
|
|
|
|
},
|
2024-07-24 12:47:21 +00:00
|
|
|
{
|
|
|
|
source: '/auth/:path*',
|
|
|
|
destination: 'http://localhost:42110/auth/:path*',
|
|
|
|
},
|
2024-08-03 22:54:09 +00:00
|
|
|
{
|
|
|
|
source: '/static/:path*',
|
|
|
|
destination: 'http://localhost:42110/static/:path*',
|
|
|
|
},
|
2024-06-22 14:42:41 +00:00
|
|
|
];
|
|
|
|
},
|
|
|
|
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",
|
|
|
|
},
|
2024-06-27 13:15:38 +00:00
|
|
|
] : [
|
|
|
|
{
|
|
|
|
protocol: "https",
|
|
|
|
hostname: "*"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
protocol: "http",
|
|
|
|
hostname: "*"
|
|
|
|
}
|
|
|
|
]
|
2024-06-22 14:42:41 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default nextConfig;
|