mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-12-19 10:57:45 +00:00
39 lines
1 KiB
JavaScript
39 lines
1 KiB
JavaScript
|
/** @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*',
|
||
|
},
|
||
|
];
|
||
|
},
|
||
|
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",
|
||
|
},
|
||
|
] : undefined,
|
||
|
}
|
||
|
};
|
||
|
|
||
|
export default nextConfig;
|