-
Notifications
You must be signed in to change notification settings - Fork 275
Expand file tree
/
Copy pathnext.config.ts
More file actions
36 lines (33 loc) · 1.03 KB
/
Copy pathnext.config.ts
File metadata and controls
36 lines (33 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import type { NextConfig } from "next";
import { readFileSync } from "fs";
import { join } from "path";
const { version } = JSON.parse(readFileSync(join(__dirname, "package.json"), "utf8")) as { version: string };
let piVersion = "unknown";
try {
const piPkgPath = join(__dirname, "node_modules/@earendil-works/pi-coding-agent/package.json");
piVersion = (JSON.parse(readFileSync(piPkgPath, "utf8")) as { version: string }).version;
} catch { /* package not found, use default */ }
const nextConfig: NextConfig = {
serverExternalPackages: [
"@earendil-works/pi-coding-agent",
"@earendil-works/pi-agent-core",
"@earendil-works/pi-ai",
"@earendil-works/pi-tui",
],
allowedDevOrigins: ['192.168.*.*'],
async headers() {
return [
{
source: "/",
headers: [
{ key: "Cache-Control", value: "private, no-cache, max-age=0, must-revalidate" },
],
},
];
},
env: {
NEXT_PUBLIC_APP_VERSION: version,
NEXT_PUBLIC_PI_VERSION: piVersion,
},
};
export default nextConfig;