clipfusion/next.config.ts

22 lines
598 B
TypeScript

import type { NextConfig } from "next";
const generateGitCommitHash = () => {
if (process.env.NODE_ENV === "development") return "development server";
if (!process.env.GIT_COMMIT) return "git commit hash is unavailable";
const hash = process.env.GIT_COMMIT;
if (!hash || hash.trim().length == 0) return "empty git commit hash";
return hash;
}
const gitCommitHash = generateGitCommitHash();
const nextConfig: NextConfig = {
output: "standalone",
generateBuildId: () => gitCommitHash,
env: {
BUILD_ID_ENV: gitCommitHash
}
};
export default nextConfig;