Skip to content

Commit

Permalink
fix: fixes playground when deployed to github pages (#949)
Browse files Browse the repository at this point in the history
Co-authored-by: Lukasz Gornicki <lpgornicki@gmail.com>
  • Loading branch information
kennethaasan and derberg committed Mar 18, 2024
1 parent f706a6d commit 3891754
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions playground/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
const isGithubActions = process.env.GITHUB_ACTIONS || false;

let assetPrefix;
let basePath;

if (isGithubActions) {
const repo = process.env.GITHUB_REPOSITORY.replace('asyncapi/', '');
assetPrefix = `/${repo}/`;
basePath = `/${repo}`;
}

/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
Expand All @@ -12,6 +23,8 @@ const nextConfig = {

return config;
},
assetPrefix,
basePath,
};

export default nextConfig;

0 comments on commit 3891754

Please sign in to comment.