Repository navigation
Expand file tree
/
Copy pathnext.config.ts
More file actions
77 lines (73 loc) · 2.4 KB
/
Copy pathnext.config.ts
File metadata and controls
77 lines (73 loc) · 2.4 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import type { NextConfig } from "next";
import createNextIntlPlugin from "next-intl/plugin";
const withNextIntl = createNextIntlPlugin("./src/i18n/request.ts");
const ContentSecurityPolicy = `
default-src 'self';
script-src 'self' 'unsafe-inline'${process.env.NODE_ENV === "development" ? " 'unsafe-eval'" : ""};
style-src 'self' 'unsafe-inline';
font-src 'self';
img-src 'self' blob: data:;
connect-src 'self';
frame-ancestors 'none';
`
.replace(/\s{2,}/g, " ")
.trim();
const nextConfig: NextConfig = {
reactStrictMode: true,
images: {
formats: ["image/avif", "image/webp"],
deviceSizes: [640, 768, 1024, 1280, 1536],
},
async redirects() {
// Rutas del diseño anterior que hoy están publicadas en `main`. Sin esto,
// el merge las convierte en 404 y se pierde lo que ya estaba indexado.
return [
{ source: "/open-source", destination: "/#open-source", permanent: true },
{ source: "/es/open-source", destination: "/#open-source", permanent: true },
{ source: "/en/open-source", destination: "/en#open-source", permanent: true },
{
source: "/captura-crm-soffia.webp",
destination: "/work/soffia-panel-redacted.webp",
permanent: true,
},
{
source: "/meteor-crm-dark.webp",
destination: "/work/meteor-crm-redacted.webp",
permanent: true,
},
{ source: "/services/:path*", destination: "/", permanent: true },
{ source: "/dossier/:path*", destination: "/", permanent: true },
...[
"/cv",
"/cv-alejandro-alvarado.pdf",
"/cv-alejandro-alvarado-fullstack.pdf",
].map((source) => ({
source,
destination: "/cv-alejandro-alvarado-roddcode.pdf",
permanent: true,
})),
];
},
async headers() {
return [
{
source: "/(.*)",
headers: [
{ key: "Content-Security-Policy", value: ContentSecurityPolicy },
{ 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=(), microphone=(), geolocation=()",
},
{ key: "X-DNS-Prefetch-Control", value: "on" },
],
},
];
},
experimental: {
optimizeCss: true,
},
};
export default withNextIntl(nextConfig);