Files

46 lines
1.3 KiB
TypeScript

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
output: "standalone",
experimental: {
cpus: process.env.NEXT_BUILD_CPUS ? Math.max(1, Math.min(2, Number(process.env.NEXT_BUILD_CPUS) || 2)) : 2,
memoryBasedWorkersCount: false,
},
poweredByHeader: false,
images: { qualities: [75, 85] },
async redirects() {
return [{
source: "/:path*",
has: [{ type: "host", value: "manyangles.hadlock.tech" }],
destination: "https://ma.hadlock.tech/:path*",
permanent: true,
}];
},
transpilePackages: [
"@album/contracts",
"@album/database",
"@album/email",
"@album/storage",
],
async headers() {
const securityHeaders = [
{ key: "X-Content-Type-Options", value: "nosniff" },
{ key: "X-Frame-Options", value: "DENY" },
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
{
key: "Permissions-Policy",
value: "camera=(), geolocation=(), microphone=(), payment=()",
},
];
if (process.env.NODE_ENV === "production") {
securityHeaders.push({
key: "Strict-Transport-Security",
value: "max-age=31536000; includeSubDomains",
});
}
return [{ source: "/(.*)", headers: securityHeaders }];
},
};
export default nextConfig;