Skip to content

Commit 13f7343

Browse files
committed
improve: use GITHUB_ACTIONS env var for basePath detection
- Replace NODE_ENV check with GITHUB_ACTIONS detection - More explicit and safer for GitHub Pages deployment - Keeps basePath empty for local development
1 parent 20e9419 commit 13f7343

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/next.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ const withNextra = require("nextra")({
33
themeConfig: "./theme.config.tsx"
44
})
55

6+
const isGitHubPages = process.env.GITHUB_ACTIONS === 'true'
7+
68
module.exports = withNextra({
79
reactStrictMode: true,
810
trailingSlash: true,
@@ -11,5 +13,5 @@ module.exports = withNextra({
1113
images: {
1214
unoptimized: true
1315
},
14-
basePath: process.env.NODE_ENV === 'production' ? "/evolution-sdk" : "",
16+
basePath: isGitHubPages ? "/evolution-sdk" : "",
1517
})

0 commit comments

Comments
 (0)