2026-07-19 23:18:42 +00:00
|
|
|
/** @type {import('next').NextConfig} */
|
|
|
|
|
const nextConfig = {
|
2026-07-20 10:11:00 +00:00
|
|
|
// Build outputs:
|
|
|
|
|
// NEXT_EXPORT=true → static export (for static-site hosts)
|
|
|
|
|
// (default) → standalone (for Docker / Node hosts like Coolify)
|
|
|
|
|
// Standalone bundles only the files Next.js needs at runtime, so the Docker
|
|
|
|
|
// image is much smaller than a full `node_modules` copy.
|
|
|
|
|
...(process.env.NEXT_EXPORT === 'true'
|
|
|
|
|
? { output: 'export' }
|
|
|
|
|
: { output: 'standalone' }),
|
2026-07-19 23:18:42 +00:00
|
|
|
images: { unoptimized: true },
|
|
|
|
|
trailingSlash: true,
|
|
|
|
|
// Headers to make the app work well as a PWA and to allow the camera/getUserMedia APIs.
|
|
|
|
|
async headers() {
|
|
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
source: '/sw.js',
|
|
|
|
|
headers: [
|
|
|
|
|
{ key: 'Content-Type', value: 'application/javascript; charset=utf-8' },
|
|
|
|
|
{ key: 'Cache-Control', value: 'no-cache, no-store, must-revalidate' },
|
|
|
|
|
{ key: 'Service-Worker-Allowed', value: '/' },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
source: '/(.*)',
|
|
|
|
|
headers: [
|
|
|
|
|
// Disable Permissions-Policy for getUserMedia so the camera works inside an iframe if needed.
|
|
|
|
|
{ key: 'Permissions-Policy', value: 'camera=(self), geolocation=(self)' },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default nextConfig;
|