-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
29 lines (25 loc) · 751 Bytes
/
Copy pathnext.config.ts
File metadata and controls
29 lines (25 loc) · 751 Bytes
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
import type { NextConfig } from "next";
import path from "path";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const isGithubPages = process.env.GITHUB_PAGES === "true";
const basePath = process.env.NEXT_PUBLIC_BASE_PATH ?? "";
const nextConfig: NextConfig = {
reactStrictMode: true,
poweredByHeader: false,
outputFileTracingRoot: path.join(__dirname),
...(isGithubPages
? {
output: "export",
basePath,
assetPrefix: basePath ? `${basePath}/` : undefined,
trailingSlash: true,
}
: {}),
images: {
unoptimized: isGithubPages,
formats: ["image/avif", "image/webp"],
},
};
export default nextConfig;