/** @type {import('next').NextConfig} */ const nextConfig = { eslint: { // Warning: This allows production builds to successfully complete even if // your project has ESLint errors. ignoreDuringBuilds: false, }, typescript: { // !! WARN !! // Dangerously allow production builds to successfully complete even if // your project has type errors. // !! WARN !! ignoreBuildErrors: false, }, images: { domains: ['tile.openstreetmap.org'], dangerouslyAllowSVG: true, }, env: { NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3001/api', NEXT_PUBLIC_MAP_TILES_URL: process.env.NEXT_PUBLIC_MAP_TILES_URL || 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', }, webpack: (config) => { // Handle canvas package for react-leaflet config.externals = config.externals || []; config.externals.push('canvas'); return config; }, // Enable PWA features headers: async () => { return [ { source: '/(.*)', headers: [ { key: 'X-Frame-Options', value: 'DENY', }, { key: 'X-Content-Type-Options', value: 'nosniff', }, { key: 'Referrer-Policy', value: 'origin-when-cross-origin', }, ], }, ]; }, // Optimize bundle size compiler: { removeConsole: process.env.NODE_ENV === 'production', }, }; module.exports = nextConfig;