task-board/next.config.mjs
2025-06-24 14:26:42 +04:00

56 lines
1.3 KiB
JavaScript

/** @type {import('next').NextConfig} */
const nextConfig = {
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
experimental: {
serverComponentsExternalPackages: ['bcryptjs'],
},
output: 'standalone',
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'picsum.photos',
},
{
protocol: 'https',
hostname: 'via.placeholder.com',
},
],
dangerouslyAllowSVG: true,
},
async headers() {
return [
{
source: '/api/:path*',
headers: [
{ key: 'Access-Control-Allow-Origin', value: '*' },
{ key: 'Access-Control-Allow-Methods', value: 'GET, POST, PUT, DELETE, OPTIONS' },
{ key: 'Access-Control-Allow-Headers', value: 'Content-Type, Authorization' },
],
},
];
},
async rewrites() {
return process.env.NODE_ENV === 'production' ? [
{
source: '/uploads/:path*',
destination: '/api/uploads/:path*',
},
] : [];
},
webpack: (config, { isServer }) => {
if (isServer) {
config.externals.push('bcryptjs');
}
// Add this to handle Edge Runtime issues
config.resolve.fallback = { ...config.resolve.fallback, fs: false };
return config;
},
};
export default nextConfig;