import type { NextConfig } from "next"; const nextConfig: NextConfig = { // Allow remote images from Wikimedia Commons images: { remotePatterns: [ { protocol: "https", hostname: "upload.wikimedia.org", port: "", pathname: "/wikipedia/commons/**", search: "", }, ], }, // Turbopack config (Next.js 16 default) turbopack: { resolveAlias: { // Optional ML backends — not installed, dynamic import fallback to mock "@tensorflow/tfjs": "./src/stubs/empty.ts", "@tensorflow/tfjs-node": "./src/stubs/empty.ts", "onnxruntime-node": "./src/stubs/empty.ts", }, }, // Webpack config (fallback) webpack: (config) => { config.resolve.alias = { ...config.resolve.alias, sharp: false, "detect-libc": false, "@tensorflow/tfjs": false, "@tensorflow/tfjs-node": false, "onnxruntime-node": false, }; return config; }, }; export default nextConfig;