From f2a4e4e422e4818ca7780c1335b510249cdcfb05 Mon Sep 17 00:00:00 2001 From: Pratyush Sharma <56130065+pratyush618@users.noreply.github.com> Date: Sun, 3 May 2026 01:24:26 +0530 Subject: [PATCH] fix(docs-next): scope basePath to production builds `basePath: '/taskito'` is correct for the deployed GH Pages URL but makes `pnpm dev` 404 at `localhost:3000` because the app moves to `localhost:3000/taskito`. Apply the basePath only when NODE_ENV=production so dev hits the root. --- docs-next/next.config.mjs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs-next/next.config.mjs b/docs-next/next.config.mjs index ebe9133..9cb32b4 100644 --- a/docs-next/next.config.mjs +++ b/docs-next/next.config.mjs @@ -2,10 +2,16 @@ import { createMDX } from "fumadocs-mdx/next"; const withMDX = createMDX(); +// `basePath` is only needed for the deployed GH Pages URL +// (docs.byteveda.org/taskito). In dev (`pnpm dev`) it makes `localhost:3000` +// 404 because the app moves to `localhost:3000/taskito`. Scope it to +// production so dev hits the root. +const isProd = process.env.NODE_ENV === "production"; + /** @type {import('next').NextConfig} */ const config = { output: "export", - basePath: "/taskito", + basePath: isProd ? "/taskito" : "", reactStrictMode: true, images: { unoptimized: true,