import type { NextConfig } from "next"; import path from "path"; const nextConfig: NextConfig = { output: "standalone", allowedDevOrigins: ["192.168.1.64"], turbopack: {}, // Compression compress: true, // Image optimization images: { formats: ["image/avif", "image/webp"], remotePatterns: [ { protocol: "https", hostname: "habibapp.com", }, ], }, // Webpack config for data-locator injection in development webpack: (config, { dev }) => { if (dev) { config.module.rules.push({ test: /\.(tsx|jsx)$/, exclude: /node_modules/, use: [ { loader: path.resolve(__dirname, "src/plugins/jsx-locator-loader.cjs"), }, ], }); } return config; }, // Headers for caching and preload async headers() { return [ { source: "/:path*", headers: [ { key: "Cache-Control", value: "public, max-age=3600, stale-while-revalidate=86400", }, ], }, { source: "/fonts/:path*", headers: [ { key: "Cache-Control", value: "public, max-age=31536000, immutable", }, ], }, ]; }, }; export default nextConfig;