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,