2026-11-09 10:54:31 -06:00
|
|
|
import { execSync } from "node:child_process";
|
2026-11-04 10:53:45 -06:00
|
|
|
import type { NextConfig } from "next";
|
|
|
|
|
|
2026-11-09 10:54:31 -06:00
|
|
|
// When the code this copy runs was last changed (its newest commit), for "A new version of broke is ready".
|
|
|
|
|
let builtFrom = "";
|
|
|
|
|
try {
|
|
|
|
|
builtFrom = execSync("git log -1 --format=%cI", { stdio: ["ignore", "pipe", "ignore"] }).toString().trim();
|
|
|
|
|
} catch {
|
|
|
|
|
/* no git (a download without history): the update check stays quiet */
|
|
|
|
|
}
|
|
|
|
|
|
2026-11-04 10:53:45 -06:00
|
|
|
const nextConfig: NextConfig = {
|
|
|
|
|
devIndicators: false,
|
|
|
|
|
distDir: process.env.NEXT_DIST_DIR || ".next", // a production build can sit beside the running dev server
|
|
|
|
|
serverExternalPackages: ["pg"],
|
2026-11-09 10:54:31 -06:00
|
|
|
env: { BROKE_BUILT_FROM: builtFrom },
|
2026-11-04 10:53:45 -06:00
|
|
|
// Keep pages you visited for 3 min, so going back or switching tabs is instant. Every edit calls router.refresh(),
|
|
|
|
|
// which drops the cache, so changes still show at once.
|
|
|
|
|
experimental: { staleTimes: { dynamic: 180 } },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default nextConfig;
|