Skip to content

Commit 3891754

Browse files
fix: fixes playground when deployed to github pages (#949)
Co-authored-by: Lukasz Gornicki <[email protected]>
1 parent f706a6d commit 3891754

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

playground/next.config.mjs

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
const isGithubActions = process.env.GITHUB_ACTIONS || false;
2+
3+
let assetPrefix;
4+
let basePath;
5+
6+
if (isGithubActions) {
7+
const repo = process.env.GITHUB_REPOSITORY.replace('asyncapi/', '');
8+
assetPrefix = `/${repo}/`;
9+
basePath = `/${repo}`;
10+
}
11+
112
/** @type {import('next').NextConfig} */
213
const nextConfig = {
314
output: 'export',
@@ -12,6 +23,8 @@ const nextConfig = {
1223

1324
return config;
1425
},
26+
assetPrefix,
27+
basePath,
1528
};
1629

1730
export default nextConfig;

0 commit comments

Comments
 (0)