DieselDepot-APP/next.config.mjs
SJCoetz d76e4fffd4 build: update next config, add dockerignore and fix UI button classes
- Update Next.js config to default to standalone build mode and add build mode documentation
- Add .dockerignore to minimize Docker build context size
- Fix missing "btn" base class on admin create user submit button
- Refactor delivery page filter buttons to use semantic segment classes with proper accessibility attributes
- Clean up old webpack hot update bundle files
- Update generated Next.js build manifest and cache files
2026-07-20 12:11:00 +02:00

35 lines
1.2 KiB
JavaScript

/** @type {import('next').NextConfig} */
const nextConfig = {
// 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' }),
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;