learning_ai_notes/web/next.config.ts

62 lines
1.3 KiB
TypeScript

import path from "node:path";
import type { NextConfig } from "next";
const securityHeaders = [
{
key: "X-Frame-Options",
value: "DENY",
},
{
key: "X-Content-Type-Options",
value: "nosniff",
},
{
key: "Referrer-Policy",
value: "strict-origin-when-cross-origin",
},
{
key: "Permissions-Policy",
value: "camera=(), microphone=(), geolocation=()",
},
];
const nextConfig: NextConfig = {
...(process.env.VERCEL
? {}
: {
output: "standalone",
outputFileTracingRoot: path.join(process.cwd(), ".."),
}),
transpilePackages: [
"@bytelyst/api-client",
"@bytelyst/blob-client",
"@bytelyst/broadcast-client",
"@bytelyst/dashboard-components",
"@bytelyst/design-tokens",
"@bytelyst/diagnostics-client",
"@bytelyst/extraction",
"@bytelyst/feature-flag-client",
"@bytelyst/feedback-client",
"@bytelyst/kill-switch-client",
"@bytelyst/offline-queue",
"@bytelyst/platform-client",
"@bytelyst/react-auth",
"@bytelyst/survey-client",
"@bytelyst/telemetry-client",
],
webpack: (config) => {
config.resolve.symlinks = true;
return config;
},
async headers() {
return [
{
source: "/(.*)",
headers: securityHeaders,
},
];
},
};
export default nextConfig;