67bd0d0bbb
Hop-State: A_06FP97T67MMQBS4JYJVZ710 Hop-Proposal: R_06FP97R88JYXTBZTNVXV08G Hop-Task: T_06FP95PNKD7PXAMPWPRWSD8 Hop-Attempt: AT_06FP95PNKE2R52XYNMKVRWG
33 lines
766 B
TypeScript
33 lines
766 B
TypeScript
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'],
|
|
|
|
// Turbopack configuration
|
|
turbopack: {
|
|
root: process.cwd(),
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|