File tree Expand file tree Collapse file tree 3 files changed +382
-15
lines changed
Expand file tree Collapse file tree 3 files changed +382
-15
lines changed Original file line number Diff line number Diff line change 11/** @type {import('next').NextConfig } */
2+ const isGitHubPages = process . env . GITHUB_PAGES === "true" ;
3+ const repo = "agentapi" ;
4+ const subPath = "chat" ; // Subdirectory within the repo
5+
26const nextConfig = {
37 // Enable static exports
4- output : ' export' ,
5-
8+ output : " export" ,
9+
610 // Disable image optimization since it's not supported in static exports
711 images : {
812 unoptimized : true ,
913 } ,
10-
11- // Remove headers config for static export
14+
15+ // Configure base path for GitHub Pages (repo/chat)
16+ basePath : isGitHubPages ? `/${ repo } /${ subPath } ` : "" ,
17+
18+ // Configure asset prefix for GitHub Pages - helps with static asset loading
19+ assetPrefix : isGitHubPages ? `/${ repo } /${ subPath } /` : "" ,
20+
21+ // Configure trailing slashes (recommended for static exports)
22+ trailingSlash : true ,
1223} ;
1324
14- export default nextConfig ;
25+ export default nextConfig ;
You can’t perform that action at this time.
0 commit comments