next.config.mjs 536 B

12345678910111213141516
  1. import os from "node:os";
  2. const localNetworkHosts = Object.values(os.networkInterfaces())
  3. .flat()
  4. .filter((address) => address && address.family === "IPv4" && !address.internal)
  5. .map((address) => address.address);
  6. /** @type {import('next').NextConfig} */
  7. const nextConfig = {
  8. reactStrictMode: true,
  9. // Next.js protects development assets with an origin allowlist. Detect the
  10. // machine's current LAN addresses at startup so no local IP is hard-coded.
  11. allowedDevOrigins: localNetworkHosts,
  12. };
  13. export default nextConfig;