diff --git a/next.config.ts b/next.config.ts index 7541a2897b..88d9102652 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,7 +1,17 @@ +import { execSync } from "node:child_process"; import type { NextConfig } from "next"; +const getGitCommit = () => { + try { + return execSync("git rev-parse HEAD", { encoding: "utf8" }).trim(); + } catch { + return undefined; + } +}; + const nextConfig: NextConfig = { - serverExternalPackages: ["lzma-js"], + deploymentId: process.env.NEXT_DEPLOYMENT_ID?.trim() || getGitCommit(), + serverExternalPackages: ["lzma"], }; export default nextConfig;