Skip to content

Commit

Permalink
Update next.config.mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
firasbk7770 authored Jul 2, 2024
1 parent d13bdc3 commit 9bef714
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
const isGithubActions = process.env.GITHUB_ACTIONS || false;

let assetPrefix = "";
let basePath = "";

if (isGithubActions) {
const repo = process.env.GITHUB_REPOSITORY.replace(/.*?\//, "");

assetPrefix = `/${repo}/`;
basePath = `/${repo}`;
}

/** @type {import('next').NextConfig} */
const nextConfig = {
output: "export", // <=== enables static exports
reactStrictMode: true,
assetPrefix,
basePath,
output: "export", // Ensure this line is present
images: {
unoptimized: true,
},
};

module.exports = nextConfig;
export default nextConfig;

0 comments on commit 9bef714

Please sign in to comment.