Show commit builds and mandate automatic node updates
Hop-State: A_06FP97T67MMQBS4JYJVZ710 Hop-Proposal: R_06FP97R88JYXTBZTNVXV08G Hop-Task: T_06FP95PNKD7PXAMPWPRWSD8 Hop-Attempt: AT_06FP95PNKE2R52XYNMKVRWG
This commit is contained in:
@@ -1,6 +1,25 @@
|
||||
import type { NextConfig } from "next";
|
||||
import { execFileSync } from "node:child_process";
|
||||
|
||||
function getBuildCommit(): string {
|
||||
if (process.env.APP_COMMIT) return process.env.APP_COMMIT;
|
||||
|
||||
try {
|
||||
return execFileSync('git', ['rev-parse', 'HEAD'], {
|
||||
cwd: process.cwd(),
|
||||
encoding: 'utf8',
|
||||
}).trim();
|
||||
} catch {
|
||||
return 'unknown';
|
||||
}
|
||||
}
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
env: {
|
||||
APP_COMMIT: getBuildCommit(),
|
||||
APP_BUILD_DATE: process.env.APP_BUILD_DATE || new Date().toISOString(),
|
||||
},
|
||||
|
||||
// Turso ships a platform-native Node module and must remain a runtime dependency.
|
||||
serverExternalPackages: ['@tursodatabase/database'],
|
||||
|
||||
|
||||
Reference in New Issue
Block a user