From 2daa2cb53f41f9eea60601363391bd0532b83f3e Mon Sep 17 00:00:00 2001 From: marius-mather Date: Wed, 18 Sep 2024 11:59:50 +1000 Subject: [PATCH] Comments on why we have the GH-specific next config --- next_ghpages.config.mjs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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);