Skip to content

Commit 752df43

Browse files
committed
Prep for custom domain
1 parent 5186ac0 commit 752df43

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

next.config.mjs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
const repositoryName = process.env.GITHUB_REPOSITORY?.split("/")[1] ?? "";
33
const isUserPagesRepo = repositoryName.endsWith(".github.io");
44
const basePath =
5-
process.env.GITHUB_ACTIONS === "true" && repositoryName && !isUserPagesRepo
5+
process.env.CUSTOM_DOMAIN !== "true" &&
6+
process.env.GITHUB_ACTIONS === "true" &&
7+
repositoryName &&
8+
!isUserPagesRepo
69
? `/${repositoryName}`
710
: "";
811

@@ -11,13 +14,13 @@ const nextConfig = {
1114
output: "export",
1215
trailingSlash: true,
1316
env: {
14-
NEXT_PUBLIC_BASE_PATH: basePath
17+
NEXT_PUBLIC_BASE_PATH: basePath,
1518
},
1619
images: {
17-
unoptimized: true
20+
unoptimized: true,
1821
},
1922
basePath,
20-
assetPrefix: basePath || undefined
23+
assetPrefix: basePath || undefined,
2124
};
2225

2326
export default nextConfig;

0 commit comments

Comments
 (0)