import type { NextConfig } from "next"; const nextConfig: NextConfig = { // Native SQLite driver: load from node_modules at runtime instead of bundling. serverExternalPackages: ["@libsql/client", "libsql"], // The Docker image runs the standalone server: only the files the server needs instead of all of // node_modules (see Dockerfile). Local `next build` / `next start` stay as they are. output: process.env.NEXT_OUTPUT === "standalone" ? "standalone" : undefined, // Nothing uses next/image (model cards show the Hub's images as they are). With the optimizer off // (/_next/image answers 404), sharp and its native libvips (28 MB) stay out of the standalone // output; "next-server" is the key Next applies to its own server's trace. images: { unoptimized: true }, outputFileTracingExcludes: { "next-server": ["**/node_modules/sharp/**/*", "**/node_modules/@img/**/*"] }, }; export default nextConfig;