-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.js
More file actions
67 lines (64 loc) · 2.01 KB
/
Copy pathnext.config.js
File metadata and controls
67 lines (64 loc) · 2.01 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
const { createVanillaExtractPlugin } = require("@vanilla-extract/next-plugin")
const withVanillaExtract = createVanillaExtractPlugin({
unstable_turbopack: { mode: "auto" },
})
/** @type {import('next').NextConfig} */
const nextConfig = {
allowedDevOrigins: ["127.0.0.1"],
output: "export",
reactStrictMode: true,
reactCompiler: {
compilationMode: "annotation",
},
images: {
// GitHub Pages does not support Next.js image optimization pipelines
unoptimized: true,
},
trailingSlash: true,
/**
* Security and anti-scraping headers
*
* These headers serve two purposes:
* 1. SEO: Allow legitimate search engines to index the site
* 2. Anti-AI: Explicitly block AI training crawlers from using the content
*
* The X-Robots-Tag header is the HTTP equivalent of the meta robots tag.
* The "noai" and "noimageai" directives instruct compliant crawlers not to
* use the content for AI training or image generation models.
*/
async headers() {
return [
{
// Apply to all routes
source: "/:path*",
headers: [
{
key: "X-Robots-Tag",
// Allow indexing and following links, but prohibit AI training usage
value: "index, follow, noai, noimageai",
},
{
key: "Content-Signal",
value: "search=yes,ai-train=no",
},
{
key: "Permissions-Policy",
// Disable FLoC (Federated Learning of Cohorts) - Google's privacy-invasive tracking
value: "interest-cohort=()",
},
{
key: "X-Content-Type-Options",
// Prevent MIME type sniffing, which can lead to security vulnerabilities
value: "nosniff",
},
{
key: "Referrer-Policy",
// Send full referrer for same-origin, only origin for cross-origin
value: "strict-origin-when-cross-origin",
},
],
},
]
},
}
module.exports = withVanillaExtract(nextConfig)