Files
Momento/memento-note/next.config.ts
sepehr 0fbb8aa599
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 42s
fix: serve uploaded images via API route (public/ is read-only in production)
Next.js bakes public/ at build time — dynamically uploaded files were
never served in Docker standalone mode. Store uploads in data/uploads/
and serve via /api/uploads/ with a rewrite for backward compatibility.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-27 22:56:22 +02:00

34 lines
916 B
TypeScript

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// Enable standalone output for Docker
output: 'standalone',
// Serve dynamically uploaded files via API route (public/ is read-only in production)
async rewrites() {
return [
{
source: '/uploads/:path*',
destination: '/api/uploads/:path*',
},
]
},
// Image optimization (enabled for better performance)
images: {
formats: ['image/avif', 'image/webp'],
},
// Hide the "compiling" indicator
devIndicators: false,
// Disable strict mode: React 19 strict mode can cause double-invocation of render
// functions during concurrent transitions, amplifying timing issues.
reactStrictMode: false,
// TEMP: disable Turbopack due React #310 loop on /admin routes in production builds.
// We keep webpack pipeline until upstream fix is confirmed.
};
export default nextConfig;