Skip to content

Commit ae87488

Browse files
authored
introduce vercel NEXT_PUBLIC_DOCS_BASE_PATH to avoid logo rendering to the wrong path (#1448)
**Test Plan** Test manually
1 parent f41e78b commit ae87488

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

next.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ const nextConfig = {
1111
// VERCEL_ENV is a system env var set by Vercel
1212
// https://vercel.com/docs/projects/environment-variables/system-environment-variables
1313
// basePath: process.env.VERCEL_ENV === 'production' ? '/docs' : '',
14-
basePath: process.env.VERCEL_ENV === 'production' ? '/docs' : ''
14+
basePath: process.env.VERCEL_ENV === 'production' ? '/docs' : '',
15+
env: {
16+
NEXT_PUBLIC_DOCS_BASE_PATH:
17+
process.env.VERCEL_ENV === 'production' ? '/docs' : ''
18+
}
1519
};
1620

1721
module.exports = async () => {

src/components/Logo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export function Logo(props: React.ComponentPropsWithoutRef<'svg'>) {
2-
const basePath = process.env.VERCEL_ENV === 'production' ? '/docs' : '';
2+
const basePath = process.env.NEXT_PUBLIC_DOCS_BASE_PATH || '';
33

44
return (
55
<>

0 commit comments

Comments
 (0)