ifixkart-storefront/next.config.ts

55 lines
1.2 KiB
TypeScript

import type { NextConfig } from 'next';
const nextConfig: NextConfig = {
experimental: {
optimizePackageImports: ['lucide-react', 'framer-motion', 'date-fns'],
},
turbopack: {
root: process.cwd(),
},
async rewrites() {
const backendUrl = process.env.NEXT_PUBLIC_API_URL || 'https://ifixkartbe.trionixsolution.com';
return [
{
source: '/api/v1/:path*',
destination: `${backendUrl}/api/v1/:path*`,
},
{
source: '/uploads/:path*',
destination: `${backendUrl}/uploads/:path*`,
},
];
},
images: {
unoptimized: true,
remotePatterns: [
{
protocol: 'http',
hostname: 'localhost',
port: '8000',
pathname: '/uploads/**',
},
{
protocol: 'http',
hostname: '127.0.0.1',
port: '8000',
pathname: '/uploads/**',
},
{
protocol: 'https',
hostname: 'ifixkartbe.trionixsolution.com',
pathname: '/uploads/**',
},
{
protocol: 'https',
hostname: 'images.unsplash.com',
},
{
protocol: 'https',
hostname: 's3ng.cashify.in',
},
],
},
};
export default nextConfig;