-
Notifications
You must be signed in to change notification settings - Fork 538
Expand file tree
/
Copy pathnext.config.ts
More file actions
50 lines (47 loc) · 1.41 KB
/
Copy pathnext.config.ts
File metadata and controls
50 lines (47 loc) · 1.41 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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: [
"undici",
"@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" },
],
},
{
source: "/sw.js",
headers: [
{ key: "Cache-Control", value: "public, max-age=0, must-revalidate" },
{ key: "Service-Worker-Allowed", value: "/" },
],
},
{
source: "/manifest.webmanifest",
headers: [
{ key: "Cache-Control", value: "public, max-age=0, must-revalidate" },
],
},
];
},
env: {
NEXT_PUBLIC_APP_VERSION: version,
NEXT_PUBLIC_PI_VERSION: piVersion,
},
};
export default nextConfig;