All checks were successful
Build and Deploy / build-deploy (push) Successful in 32s
41 lines
989 B
TypeScript
41 lines
989 B
TypeScript
import type { NextConfig } from "next";
|
|
|
|
const isDev = process.env.NODE_ENV === "development";
|
|
|
|
const csp = [
|
|
"default-src 'self'",
|
|
`script-src 'self' 'unsafe-inline'${isDev ? " 'unsafe-eval'" : ""}`,
|
|
"style-src 'self' 'unsafe-inline'",
|
|
"img-src 'self' data: blob:",
|
|
"font-src 'self'",
|
|
"connect-src 'self'",
|
|
"object-src 'none'",
|
|
"base-uri 'self'",
|
|
"form-action 'self'",
|
|
"frame-ancestors 'none'",
|
|
"upgrade-insecure-requests",
|
|
].join("; ");
|
|
|
|
const securityHeaders = [
|
|
{ key: "Content-Security-Policy", value: csp },
|
|
{ key: "X-Frame-Options", value: "DENY" },
|
|
{ key: "X-Content-Type-Options", value: "nosniff" },
|
|
{ key: "Referrer-Policy", value: "same-origin" },
|
|
];
|
|
|
|
const nextConfig: NextConfig = {
|
|
reactCompiler: true,
|
|
output: "standalone",
|
|
images: {
|
|
unoptimized: true,
|
|
},
|
|
experimental: {
|
|
sri: { algorithm: "sha256" },
|
|
},
|
|
async headers() {
|
|
return [{ source: "/:path*", headers: securityHeaders }];
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|