-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
45 lines (41 loc) · 1.22 KB
/
next.config.mjs
File metadata and controls
45 lines (41 loc) · 1.22 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
import { execSync } from "node:child_process";
const headers = [
{ key: "X-Clacks-Overhead", value: "GNU Hans Steiner, Terry Davis" }, // https://xclacksoverhead.org/
{ key: "X-ServerNickname", value: "Pixel" },
{ key: "X-Hacker", value: "Please open a issue on https://github.com/mellowagain/website" },
];
const gitHash = execSync("git rev-parse --short HEAD").toString().trim();
const gitDate = execSync('git log -1 --format=%cd --date=format:"%d %B %Y"').toString().trim();
/** @type {import('next').NextConfig} */
const nextConfig = {
pageExtensions: ["js", "jsx", "md", "mdx", "ts", "tsx"],
typescript: {
ignoreBuildErrors: true,
},
images: {
unoptimized: false,
localPatterns: [
{
pathname: "/images/**/*.{jpg,png,svg}",
search: "",
},
],
},
env: {
NEXT_PUBLIC_GIT_HASH: gitHash,
NEXT_PUBLIC_GIT_DATE: gitDate,
},
async headers() {
return [
{
source: "/",
headers: headers,
},
{
source: "/:path*",
headers: headers,
},
];
},
};
export default nextConfig;