Files
portifolio-evandrodevbr/next.config.ts
T
Evandro Fonseca Junior dfcadc71fa
CI / verify (push) Failing after 5m29s
wip: foto da pasta principal antes de trocar de branch
Estado do disco em 14/10/2026, sem filtrar. Inclui as copias .sync-conflict-* do Syncthing de 07/10 e os 15 arquivos que o Syncthing apagou; todo esse conteudo ja existia em outros commits. So havia fora do Git: AGENTS.md, CLAUDE.md e a alteracao em data/project-health.json.
2026-10-14 00:42:49 -03:00

80 lines
2.0 KiB
TypeScript

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// Otimização de imagens
images: {
formats: ["image/webp", "image/avif"],
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
minimumCacheTTL: 60,
},
turbopack: {
root: process.cwd(),
},
async headers(): Promise<
Array<{ source: string; headers: Array<{ key: string; value: string }> }>
> {
const scriptSources = [
"'self'",
"'unsafe-inline'",
...(process.env.NODE_ENV === "production" ? [] : ["'unsafe-eval'"]),
"https://www.googletagmanager.com",
].join(" ");
const contentSecurityPolicy = [
"default-src 'self'",
`script-src ${scriptSources}`,
"connect-src 'self' https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com",
"img-src 'self' data: blob: https://*.google-analytics.com https://www.googletagmanager.com",
"style-src 'self' 'unsafe-inline'",
"font-src 'self' data:",
"frame-ancestors 'none'",
"object-src 'none'",
"base-uri 'self'",
"form-action 'self'",
].join("; ");
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=()",
},
{
key: "Content-Security-Policy-Report-Only",
value: contentSecurityPolicy,
},
];
if (process.env.NODE_ENV === "production") {
securityHeaders.push({
key: "Strict-Transport-Security",
value: "max-age=31536000; includeSubDomains; preload",
});
}
return [
{
source: "/(.*)",
headers: securityHeaders,
},
];
},
// Compressão
compress: true,
};
export default nextConfig;