fix: make output export build-only so dev route handlers work

This commit is contained in:
Ilia Mashkov
2026-05-07 12:28:42 +03:00
parent f163b750b2
commit ced77f6f07
2 changed files with 9 additions and 5 deletions
+8 -4
View File
@@ -1,8 +1,12 @@
import type { NextConfig } from 'next'
import type { NextConfig } from 'next';
const isExport = process.env.NODE_ENV === 'production';
const nextConfig: NextConfig = {
output: 'export',
/* output: 'export' only applies at build time — enabling it in dev mode
* breaks route handlers (incompatible with force-dynamic in Next.js 16) */
...(isExport ? { output: 'export' } : {}),
images: { unoptimized: true },
}
};
export default nextConfig
export default nextConfig;