/** @type {import('next').NextConfig} */ const apiOrigin = (process.env.API_INTERNAL_URL ?? process.env.API_URL ?? 'http://localhost:4000').replace(/\/api\/v1\/?$/, '') const nextConfig = { images: { domains: ['res.cloudinary.com'], }, transpilePackages: ['@rentaldrivego/types'], async rewrites() { return [ { source: '/api/:path*', destination: `${apiOrigin}/api/:path*`, }, ] }, } module.exports = nextConfig