-
-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathnext.config.ts
More file actions
61 lines (56 loc) · 1.38 KB
/
Copy pathnext.config.ts
File metadata and controls
61 lines (56 loc) · 1.38 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
import nextMdx from "@next/mdx";
import type { NextConfig } from "next";
const withMdx = nextMdx({
extension: /\.mdx?$/,
});
const nextConfig: NextConfig = {
/* config options here */
reactCompiler: true,
pageExtensions: ["ts", "tsx", "md", "mdx"],
images: {
// GitHub Sponsors avatars on /sponsors. Only needed for that page,
// but the allowlist is global. Pathname locks us to avatar URLs so
// we can't be tricked into proxying arbitrary GitHub user content.
remotePatterns: [
{
protocol: "https",
hostname: "avatars.githubusercontent.com",
pathname: "/u/**",
},
],
},
/**
* 301 www → apex so both hostnames don't double-count traffic and
* SEO signals consolidate on a single canonical origin.
*/
async redirects() {
return [
{
source: "/:path*",
has: [{ type: "host", value: "www.animateicons.in" }],
destination: "https://animateicons.in/:path*",
permanent: true,
},
];
},
/**
* Mark every preview deployment (`*.vercel.app`) as noindex so search
* engines drop cached preview URLs and stop crawling them. Apex
* domain is unaffected.
*/
async headers() {
return [
{
source: "/:path*",
has: [
{
type: "host",
value: "(?<previewHost>.*\\.vercel\\.app)",
},
],
headers: [{ key: "X-Robots-Tag", value: "noindex, nofollow" }],
},
];
},
};
export default withMdx(nextConfig);