diff --git a/next_ghpages.config.mjs b/next_ghpages.config.mjs index 4079be3..07c3df9 100644 --- a/next_ghpages.config.mjs +++ b/next_ghpages.config.mjs @@ -1,13 +1,15 @@ -import bundleAnalyzer from "@next/bundle-analyzer"; +// Deploying to a GH pages site requires setting the basePath option +// (and potentially the assetPrefix option as well), this can't +// be set via CLI so instead we use a separate next.config.mjs file +// that we use during the GitHub action that builds the pages import createMDX from '@next/mdx' -const withBundleAnalyzer = bundleAnalyzer({enabled: process.env.ANALYZE === 'true'}); /** @type {import('next').NextConfig} */ const nextConfig = { output: "export", basePath: "/ace3tool", - assetPrefix: "https://sydney-informatics-hub.github.io/ace3tool/", + assetPrefix: "https://sydney-informatics-hub.github.io/ace3tool", trailingSlash: true, images: {unoptimized: true}, pageExtensions: ['md', 'mdx', 'ts', 'tsx'], @@ -17,4 +19,4 @@ const withMDX = createMDX({ // Add markdown plugins here, as desired }) -export default withMDX(withBundleAnalyzer(nextConfig)); +export default withMDX(nextConfig);