forked from SpectrAI-Initiative/InnoClaw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
40 lines (35 loc) · 1.25 KB
/
next.config.ts
File metadata and controls
40 lines (35 loc) · 1.25 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
import type { NextConfig } from "next";
import createNextIntlPlugin from "next-intl/plugin";
const withNextIntl = createNextIntlPlugin("./src/i18n/request.ts");
const securityHeaders = [
{ key: "X-Content-Type-Options", value: "nosniff" },
{ key: "X-Frame-Options", value: "SAMEORIGIN" },
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
{ key: "Permissions-Policy", value: "camera=(), microphone=(), geolocation=()" },
];
const serverExternalPackages = [
"better-sqlite3",
"pdf-parse",
// Turbopack on Windows can panic while creating the junction for this scoped package.
...(process.platform === "win32" ? [] : ["@larksuiteoapi/node-sdk"]),
];
const nextConfig: NextConfig = {
output: "standalone",
serverExternalPackages,
// Allow overriding the .next build directory via env var.
// Useful on network/shared filesystems where Turbopack cache persistence fails.
...(process.env.NEXT_BUILD_DIR ? { distDir: process.env.NEXT_BUILD_DIR } : {}),
turbopack: {
// Set the project root explicitly to avoid lockfile detection issues.
root: __dirname,
},
async headers() {
return [
{
source: "/(.*)",
headers: securityHeaders,
},
];
},
};
export default withNextIntl(nextConfig);