import type { NextConfig } from 'next'; import { readFileSync } from 'fs'; import { join } from 'path'; const versionFile = readFileSync(join(__dirname, '..', 'version.py'), 'utf8'); const versionMatch = versionFile.match(/VERSION\s*=\s*["']([^"']+)["']/); const appVersion = versionMatch ? versionMatch[1] : 'unknown'; const nextConfig: NextConfig = { env: { NEXT_PUBLIC_APP_VERSION: appVersion, }, serverExternalPackages: ['macstats', 'osx-temperature-sensor'], async rewrites() { return [ { source: '/proxy-8866/:path*', destination: 'http://localhost:8866/:path*', }, ]; }, webpack: (config, { isServer }) => { if (isServer) { config.externals.push('osx-temperature-sensor', 'macstats'); } return config; }, devIndicators: { buildActivity: false, }, typescript: { // Remove this. Build fails because of route types ignoreBuildErrors: true, }, experimental: { serverActions: { bodySizeLimit: '100gb', }, middlewareClientMaxBodySize: '100gb', }, }; export default nextConfig;