forked from chxcodepro/model-check
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
24 lines (20 loc) · 763 Bytes
/
next.config.ts
File metadata and controls
24 lines (20 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import type { NextConfig } from "next";
import { readFileSync } from "fs";
const isWindows = process.platform === "win32";
const forceStandalone = process.env.NEXT_STANDALONE === "true";
const disableStandalone = process.env.NEXT_STANDALONE === "false";
// Read version from package.json at build time
const pkg = JSON.parse(readFileSync("./package.json", "utf-8"));
const nextConfig: NextConfig = {
// Disable x-powered-by header for security
poweredByHeader: false,
// Avoid Windows traced-file copy warnings by default.
...(forceStandalone || (!isWindows && !disableStandalone)
? { output: "standalone" as const }
: {}),
// Inject build-time environment variables
env: {
APP_VERSION: pkg.version,
},
};
export default nextConfig;