ironGym/webapp/next.config.js

38 lines
1.1 KiB
JavaScript

/** @type {import('next').NextConfig} */
const nextConfig = {
typescript: {
ignoreBuildErrors: true,
},
output: 'standalone',
experimental: {
// This is needed for Docker builds
outputFileTracingRoot: process.env.NODE_ENV === 'production' ? '../' : undefined,
// Disable server-side rendering for API routes during build
// to prevent database connection attempts
serverComponentsExternalPackages: ['mongoose'],
},
// Disable server-side rendering during build for specific pages that require DB access
// This prevents connection attempts during build
exportPathMap: async function() {
return {
'/': { page: '/dashboard' },
// Add other static pages here
};
},
async redirects() {
return [
{ // we redirect '/' to '/dashboard
source: '/',
destination: '/dashboard',
permanent: true,
},
]
},
// Skip type checking during build
eslint: {
ignoreDuringBuilds: true,
},
}
module.exports = nextConfig