Isolate next dev from production .next, add build-guard/atomic deploy/health watchdog, error boundaries, and fix JWT startup, meetup leaks, media path traversal, SVG/memory uploads, and JSON-LD escaping. Co-authored-by: Cursor <cursoragent@cursor.com>
30 lines
840 B
JavaScript
30 lines
840 B
JavaScript
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
// Isolate dev and prod build output. `next start` (production) reads the
|
|
// default `.next`; `next dev` is pointed at `.next-dev` via NEXT_DIST_DIR so a
|
|
// stray dev run can never overwrite the live production manifests.
|
|
distDir: process.env.NEXT_DIST_DIR || '.next',
|
|
experimental: {
|
|
serverComponentsExternalPackages: ['sharp'],
|
|
},
|
|
images: {
|
|
remotePatterns: [
|
|
{ protocol: 'https', hostname: '**' },
|
|
],
|
|
},
|
|
async rewrites() {
|
|
const rules = [
|
|
{ source: '/calendar.ics', destination: '/calendar' },
|
|
];
|
|
if (process.env.NODE_ENV === 'development') {
|
|
rules.push({
|
|
source: '/api/:path*',
|
|
destination: 'http://127.0.0.1:4000/api/:path*',
|
|
});
|
|
}
|
|
return rules;
|
|
},
|
|
};
|
|
|
|
module.exports = nextConfig;
|