diff --git a/next.config.js b/next.config.js index 46364743d..b0b4aa4d9 100644 --- a/next.config.js +++ b/next.config.js @@ -11,7 +11,11 @@ const nextConfig = { // VERCEL_ENV is a system env var set by Vercel // https://vercel.com/docs/projects/environment-variables/system-environment-variables // basePath: process.env.VERCEL_ENV === 'production' ? '/docs' : '', - basePath: process.env.VERCEL_ENV === 'production' ? '/docs' : '' + basePath: process.env.VERCEL_ENV === 'production' ? '/docs' : '', + env: { + NEXT_PUBLIC_DOCS_BASE_PATH: + process.env.VERCEL_ENV === 'production' ? '/docs' : '' + } }; module.exports = async () => { diff --git a/src/components/Logo.tsx b/src/components/Logo.tsx index fe7d22dd6..82eec1921 100644 --- a/src/components/Logo.tsx +++ b/src/components/Logo.tsx @@ -1,5 +1,5 @@ export function Logo(props: React.ComponentPropsWithoutRef<'svg'>) { - const basePath = process.env.VERCEL_ENV === 'production' ? '/docs' : ''; + const basePath = process.env.NEXT_PUBLIC_DOCS_BASE_PATH || ''; return ( <>