Skip to content

Commit b8e8f46

Browse files
committed
build: simplify next.config.js (no top-level const), set basePath/assetPrefix literals so Actions can parse
1 parent 2f0540f commit b8e8f46

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

next.config.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
/** @type {import('next').NextConfig} */
2-
const repo = 'photography-portfolio';
3-
const isProd = process.env.NODE_ENV === 'production';
4-
const basePath = isProd ? `/${repo}` : '';
5-
6-
const nextConfig = {
2+
module.exports = {
73
reactStrictMode: true,
84
output: 'export',
9-
basePath,
10-
assetPrefix: basePath,
5+
// Use a plain object so GitHub's configure-pages step can parse/inject safely
6+
basePath: process.env.NODE_ENV === 'production' ? '/photography-portfolio' : '',
7+
assetPrefix: process.env.NODE_ENV === 'production' ? '/photography-portfolio' : '',
118
trailingSlash: true,
129
images: { unoptimized: true },
13-
env: { NEXT_PUBLIC_BASE_PATH: basePath }
10+
env: {
11+
NEXT_PUBLIC_BASE_PATH: process.env.NODE_ENV === 'production' ? '/photography-portfolio' : ''
12+
}
1413
};
15-
16-
module.exports = nextConfig;
17-

0 commit comments

Comments
 (0)